aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-03-15 09:15:01 -0700
committerJohn MacFarlane <[email protected]>2023-03-15 09:15:01 -0700
commit774e3be2651694d77a107373bc8153093244d5ff (patch)
treec2a8bc6d14e587d7371d08e46c6bfc2f3ada5adf /src
parent1c70458f3e8559d0f83d1ae56dff951fa0ae0db7 (diff)
HTML writer: use img element instead of embed for .svg.gz...
and .png.gz etc. Closes #8699.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 9f61d483c..9d1e8f7df 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -1576,7 +1576,8 @@ inlineToHtml opts inline = do
else alternate
in (tg $ H.a ! A.href (toValue s) $ toHtml linkTxt
, [A5.controls ""] )
- normSrc = maybe (T.unpack s) uriPath (parseURIReference $ T.unpack s)
+ s' = fromMaybe s $ T.stripSuffix ".gz" s
+ normSrc = maybe (T.unpack s) uriPath (parseURIReference $ T.unpack s')
(tag, specAttrs) = case mediaCategory normSrc of
Just "image" -> imageTag
Just "video" -> mediaTag H5.video "Video"