aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-28 22:04:38 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-28 22:04:38 -0800
commit012405e8c3df0ce400b05f524d14de88cf5d5115 (patch)
tree41daad63aa1c6ac57aa1c938745eabd4ab024d08 /src/Text/Pandoc/Writers
parent4fd9fb9ea24b5a30e0cfa50ec5317186af114df8 (diff)
downloadpandoc-012405e8c3df0ce400b05f524d14de88cf5d5115.tar.gz
Preserve attributes in highlighted HTML.
The container element will have the classes, id, and key-value attributes you specified in the delimited code block. Previously these were stripped off.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 3b926cf06..5b885dbfb 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -379,7 +379,7 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
in return $ foldl (!) H.pre attrs $ H.code
$ toHtml adjCode
Just h -> modify (\st -> st{ stHighlighting = True }) >>
- return h
+ return (foldl (!) h (attrsToHtml opts (id',[],keyvals)))
blockToHtml opts (BlockQuote blocks) =
-- in S5, treat list in blockquote specially
-- if default is incremental, make it nonincremental;
@@ -547,7 +547,9 @@ inlineToHtml opts inline =
Nothing -> return
$ foldl (!) H.code (attrsToHtml opts attr)
$ strToHtml str
- Just h -> return h
+ Just h -> return $ foldl (!) h $
+ attrsToHtml opts (id',[],keyvals)
+ where (id',_,keyvals) = attr
(Strikeout lst) -> inlineListToHtml opts lst >>=
return . H.del
(SmallCaps lst) -> inlineListToHtml opts lst >>=