mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
EPUB: add a method for getting Calibre bookmarks
See https://github.com/johnfactotum/foliate/issues/849
This commit is contained in:
@@ -736,4 +736,12 @@ export class EPUB {
|
|||||||
isExternal(uri) {
|
isExternal(uri) {
|
||||||
return isExternal(uri)
|
return isExternal(uri)
|
||||||
}
|
}
|
||||||
|
async getCalibreBookmarks() {
|
||||||
|
const txt = await this.loadText('META-INF/calibre_bookmarks.txt')
|
||||||
|
const magic = 'encoding=json+base64:'
|
||||||
|
if (txt?.startsWith(magic)) {
|
||||||
|
const json = atob(txt.slice(magic.length))
|
||||||
|
return JSON.parse(json)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user