From d2a6533d6e3385f5c7ff2e6b48e4c3aa8fae0ff0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 22 Oct 2016 23:07:15 +0200 Subject: EPUB reader: don't add root path to data: URIs. Closes #3150. Thanks to @lep for the bug report and patch. --- src/Text/Pandoc/Readers/EPUB.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Text') 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 -- cgit v1.2.3