git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: better handle HTML media tags.
commit91b902f02f8224ea49ae26e7889a2c5032e2a79a authorJohn MacFarlane <jgm@berkeley.edu> dateMon 7 Jul 2014, 15:46 (12 years ago) parent3d4e76f
1 file changed+6−1
src/Text/Pandoc/Writers/EPUB.hs+6−1
src/Text/Pandoc/Writers/EPUB.hs+6−1
@@ -751,7 +751,7 @@ transformTag :: WriterOptions
751751 -> Tag String
752752 -> IO (Tag String)
753753transformTag opts mediaRef tag@(TagOpen name attr)
754− | name == "video" || name == "source" || name == "img" = do
754+ | name `elem` ["video", "source", "img", "audio"] = do
755755 let src = fromAttrib "src" tag
756756 let poster = fromAttrib "poster" tag
757757 let oldsrc = maybe src (</> src) $ writerSourceURL opts
@@ -800,6 +800,11 @@ transformInline opts _ (x@(Math _ _))
800800 | WebTeX _ <- writerHTMLMathMethod opts = do
801801 raw <- makeSelfContained Nothing $ writeHtmlInline opts x
802802 return $ RawInline (Format "html") raw
803+transformInline opts mediaRef (RawInline fmt raw)
804+ | fmt == Format "html" = do
805+ let tags = parseTags raw
806+ tags' <- mapM (transformTag opts mediaRef) tags
807+ return $ RawInline fmt (renderTags tags')
803808transformInline _ _ x = return x
804809
805810writeHtmlInline :: WriterOptions -> Inline -> String