aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Schreiber <marc.schreiber@fh-aachen.de>2017-04-20 11:11:01 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-05-20 23:09:08 +0200
commit03cb05f4c614f08600bcd8e90a7fd1ca13ae33a2 (patch)
tree8b89067a627f3b05358fb14e69036cc512b85110 /src
parent5c44fd554fbebc2e01a0aa9f569468789f353bf4 (diff)
downloadpandoc-03cb05f4c614f08600bcd8e90a7fd1ca13ae33a2.tar.gz
Improve SVG image size code.
The old code made some unwise assumptions about how the svg file would look. See #3580.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/ImageSize.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index a0800e499..4d914a10c 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -116,7 +116,7 @@ imageType img = case B.take 4 img of
_ -> mzero
findSvgTag :: ByteString -> Bool
-findSvgTag img = B.null $ snd (B.breakSubstring img "<svg")
+findSvgTag img = "<svg" `B.isInfixOf` img || "<SVG" `B.isInfixOf` img
imageSize :: WriterOptions -> ByteString -> Either String ImageSize
imageSize opts img =