diff --git a/fb2.js b/fb2.js index d21a5a9..49d7231 100644 --- a/fb2.js +++ b/fb2.js @@ -71,7 +71,9 @@ const BODY = { const getImageSrc = el => { const href = el.getAttributeNS(NS.XLINK, 'href') + if (!href) return 'data:,' const [, id] = href.split('#') + if (!id) return href const bin = el.getRootNode().getElementById(id) return bin ? `data:${bin.getAttribute('content-type')};base64,${bin.textContent}`