git.iko.soy/typeable/pandoc
on master help sign in
EPUB reader: don't add root path to data: URIs.

Closes #3150. Thanks to @lep for the bug report and patch.

commitd2a6533d6e3385f5c7ff2e6b48e4c3aa8fae0ff0 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 22 Oct 2016, 23:07 (10 years ago) parent8b9cce9
1 file changed+3−1
src/Text/Pandoc/Readers/EPUB.hs+3−1
src/Text/Pandoc/Readers/EPUB.hs+3−1
@@ -109,7 +109,9 @@ iq _ = []
109109
110110-- Remove relative paths
111111renameImages :: FilePath -> Inline -> Inline
112−renameImages root (Image attr a (url, b)) = Image attr a (collapseFilePath (root </> url), b)
112+renameImages root img@(Image attr a (url, b))
113+ | "data:" `isPrefixOf` url = img
114+ | otherwise = Image attr a (collapseFilePath (root </> url), b)
113115renameImages _ x = x
114116
115117imageToPandoc :: FilePath -> Pandoc