aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-16 23:10:05 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-16 23:10:05 -0700
commitc2de9d749cbc21386e153a4f9efc3049a299cecc (patch)
tree269f7fe37dafb4ddc94c20b87c780545ee0a6658
parent514958f5eaac17b6429118f8a59f10baeeb124fd (diff)
downloadpandoc-c2de9d749cbc21386e153a4f9efc3049a299cecc.tar.gz
SelfContained: handle data-background attribute on section.
This should help with #3979. In my test, I got a data uri for data-background. But it didn't actually work in the browser (the background image didn't show). Not sure whether this is a problem in reveal.js or a problem in pandoc...
-rw-r--r--src/Text/Pandoc/SelfContained.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs
index 9ab7be6b9..36be62f0a 100644
--- a/src/Text/Pandoc/SelfContained.hs
+++ b/src/Text/Pandoc/SelfContained.hs
@@ -74,12 +74,13 @@ convertTags (t@TagOpen{}:ts)
| fromAttrib "data-external" t == "1" = (t:) <$> convertTags ts
convertTags (t@(TagOpen tagname as):ts)
| tagname `elem`
- ["img", "embed", "video", "input", "audio", "source", "track"] = do
+ ["img", "embed", "video", "input", "audio", "source", "track",
+ "section"] = do
as' <- mapM processAttribute as
rest <- convertTags ts
return $ TagOpen tagname as' : rest
where processAttribute (x,y) =
- if x == "src" || x == "data-src" || x == "href" || x == "poster"
+ if x `elem` ["src", "data-src", "href", "poster", "data-background"]
then do
enc <- getDataURI (fromAttrib "type" t) y
return (x, enc)