Skip to content

Commit

Permalink
SelfContained: handle data-background attribute on section.
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
jgm committed Oct 17, 2017
1 parent 514958f commit c2de9d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Text/Pandoc/SelfContained.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c2de9d7

Please sign in to comment.