diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-10-22 23:07:15 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-10-22 23:07:15 +0200 |
commit | d2a6533d6e3385f5c7ff2e6b48e4c3aa8fae0ff0 (patch) | |
tree | cd3d105f03eca64a726e8050d2c186374fd9ebca /src/Text/Pandoc/Readers | |
parent | 8b9cce97920d62a4b85a88eac8433512226329a9 (diff) | |
download | pandoc-d2a6533d6e3385f5c7ff2e6b48e4c3aa8fae0ff0.tar.gz |
EPUB reader: don't add root path to data: URIs.
Closes #3150.
Thanks to @lep for the bug report and patch.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/EPUB.hs | 4 |
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 |