Skip to content

Commit

Permalink
Improve footnote extraction and fallback if fails
Browse files Browse the repository at this point in the history
Fixes #1259
  • Loading branch information
johnfactotum committed Mar 26, 2024
1 parent f2c39d2 commit 0fbdd04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/foliate-js
Submodule foliate-js updated 1 files
+36 −22 footnotes.js
5 changes: 4 additions & 1 deletion src/reader/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,10 @@ class Reader {
emit({ type: 'external-link', ...e.detail })
})
this.view.addEventListener('link', e =>
this.#footnoteHandler.handle(this.book, e))
this.#footnoteHandler.handle(this.book, e)?.catch(err => {
console.warn(err)
this.view.goTo(e.detail.href)
}))
this.view.addEventListener('load', e => this.#onLoad(e))
this.view.history.addEventListener('index-change', e => {
const { canGoBack, canGoForward } = e.target
Expand Down

0 comments on commit 0fbdd04

Please sign in to comment.