git.iko.soy/typeable/pandoc
on master help sign in
EPUB reader: don't add root path to data: URIs.
d2a6533John MacFarlane
src/Text/Pandoc/Readers/EPUB.hs+3−1
@@ -109,7 +109,9 @@ iq _ = []
109
109
110-- Remove relative paths
110-- Remove relative paths
111renameImages :: FilePath -> Inline -> Inline
111renameImages :: FilePath -> Inline -> Inline
112+renameImages root img@(Image attr a (url, b))
113+ | "data:" `isPrefixOf` url = img
112−renameImages root (Image attr a (url, b)) = Image attr a (collapseFilePath (root </> url), b)
114+ | otherwise = Image attr a (collapseFilePath (root </> url), b)
113renameImages _ x = x
115renameImages _ x = x
114
116
115imageToPandoc :: FilePath -> Pandoc
117imageToPandoc :: FilePath -> Pandoc