aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-07-07 15:46:59 -0600
committerJohn MacFarlane <jgm@berkeley.edu>2014-07-07 15:53:59 -0600
commit91b902f02f8224ea49ae26e7889a2c5032e2a79a (patch)
treefc21035deb64fa56717bd9df15ba32bf76140dda /src/Text/Pandoc
parent3d4e76f34234710a5d13cfac810f581edcb69662 (diff)
downloadpandoc-91b902f02f8224ea49ae26e7889a2c5032e2a79a.tar.gz
EPUB writer: better handle HTML media tags.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs7
1 files changed, 6 insertions, 1 deletions
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