We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23838f3 commit c69cc8eCopy full SHA for c69cc8e
src/template.ts
@@ -87,11 +87,7 @@ export default `
87
88
function getCfiFromHref(book, href) {
89
const [_, id] = href.split('#')
90
- let section = book.spine.get(href.split('/')[1])
91
-
92
- if (!section) {
93
- section = book.spine.get(href);
94
- }
+ let section = book.spine.get(href.split('/')[1]) || book.spine.get(href) || book.spine.get(href.split('/').slice(1).join('/'))
95
96
const el = (id ? section.document.getElementById(id) : section.document.body)
97
return section.cfiFromElement(el)
0 commit comments