summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-10-22 23:07:15 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-10-22 23:07:15 +0200
commitd2a6533d6e3385f5c7ff2e6b48e4c3aa8fae0ff0 (patch)
treecd3d105f03eca64a726e8050d2c186374fd9ebca
parent8b9cce97920d62a4b85a88eac8433512226329a9 (diff)
EPUB reader: don't add root path to data: URIs.
Closes #3150. Thanks to @lep for the bug report and patch.
-rw-r--r--src/Text/Pandoc/Readers/EPUB.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/EPUB.hs b/src/Text/Pandoc/Readers/EPUB.hs
index e547b84cd..7b1546939 100644
--- a/src/Text/Pandoc/Readers/EPUB.hs
+++ b/src/Text/Pandoc/Readers/EPUB.hs
@@ -109,7 +109,9 @@ iq _ = []
-- Remove relative paths
renameImages :: FilePath -> Inline -> Inline
-renameImages root (Image attr a (url, b)) = Image attr a (collapseFilePath (root </> url), b)
+renameImages root img@(Image attr a (url, b))
+ | "data:" `isPrefixOf` url = img
+ | otherwise = Image attr a (collapseFilePath (root </> url), b)
renameImages _ x = x
imageToPandoc :: FilePath -> Pandoc