From 91b902f02f8224ea49ae26e7889a2c5032e2a79a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 7 Jul 2014 15:46:59 -0600 Subject: EPUB writer: better handle HTML media tags. --- src/Text/Pandoc/Writers/EPUB.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index b6687c330..f7968884e 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -751,7 +751,7 @@ transformTag :: WriterOptions -> Tag String -> IO (Tag String) transformTag opts mediaRef tag@(TagOpen name attr) - | name == "video" || name == "source" || name == "img" = do + | name `elem` ["video", "source", "img", "audio"] = do let src = fromAttrib "src" tag let poster = fromAttrib "poster" tag let oldsrc = maybe src ( src) $ writerSourceURL opts @@ -800,6 +800,11 @@ transformInline opts _ (x@(Math _ _)) | WebTeX _ <- writerHTMLMathMethod opts = do raw <- makeSelfContained Nothing $ writeHtmlInline opts x return $ RawInline (Format "html") raw +transformInline opts mediaRef (RawInline fmt raw) + | fmt == Format "html" = do + let tags = parseTags raw + tags' <- mapM (transformTag opts mediaRef) tags + return $ RawInline fmt (renderTags tags') transformInline _ _ x = return x writeHtmlInline :: WriterOptions -> Inline -> String -- cgit v1.2.3