aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-30 21:51:11 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-30 22:36:36 +0200
commit80d093843b4f782dda73054d4fc4ba9ef2a82843 (patch)
tree075da505671ae010f165c2663a8b411ce9a9f10d /src/Text/Pandoc/Writers/HTML.hs
parentea84cd0842ede0ff9835bc4aae47c949ee1d1dd2 (diff)
downloadpandoc-80d093843b4f782dda73054d4fc4ba9ef2a82843.tar.gz
Allow dynamic loading of syntax definitions.
See #3334. * Add writerSyntaxMap to WriterOptions. * Highlighting: added parameter for SyntaxMap to highlight. * Implemented --syntax-definition option. TODO: [ ] Figure out whether we want to have the xml parsing depend on the dtd (it currently does, and fails unless the language.dtd is found in the same directory). [ ] Add an option to read a KDE syntax highlighting theme as a custom style. [ ] Add tests.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 10b782de7..42726bc61 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -642,7 +642,7 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
then unlines . map ("> " ++) . lines $ rawCode
else rawCode
hlCode = if isJust (writerHighlightStyle opts)
- then highlight formatHtmlBlock
+ then highlight (writerSyntaxMap opts) formatHtmlBlock
(id',classes',keyvals) adjCode
else Left ""
case hlCode of
@@ -885,8 +885,9 @@ inlineToHtml opts inline = do
return $ addAttrs opts (id',[],keyvals) h
where (id',_,keyvals) = attr
hlCode = if isJust (writerHighlightStyle opts)
- then highlight formatHtmlInline
- attr str
+ then highlight
+ (writerSyntaxMap opts)
+ formatHtmlInline attr str
else Left ""
(Strikeout lst) -> inlineListToHtml opts lst >>=
return . H.del