mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
@@ -71,7 +71,9 @@ const BODY = {
|
|||||||
|
|
||||||
const getImageSrc = el => {
|
const getImageSrc = el => {
|
||||||
const href = el.getAttributeNS(NS.XLINK, 'href')
|
const href = el.getAttributeNS(NS.XLINK, 'href')
|
||||||
|
if (!href) return 'data:,'
|
||||||
const [, id] = href.split('#')
|
const [, id] = href.split('#')
|
||||||
|
if (!id) return href
|
||||||
const bin = el.getRootNode().getElementById(id)
|
const bin = el.getRootNode().getElementById(id)
|
||||||
return bin
|
return bin
|
||||||
? `data:${bin.getAttribute('content-type')};base64,${bin.textContent}`
|
? `data:${bin.getAttribute('content-type')};base64,${bin.textContent}`
|
||||||
|
|||||||
Reference in New Issue
Block a user