diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-30 21:51:11 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-30 22:36:36 +0200 |
commit | 80d093843b4f782dda73054d4fc4ba9ef2a82843 (patch) | |
tree | 075da505671ae010f165c2663a8b411ce9a9f10d /src/Text/Pandoc/Writers/HTML.hs | |
parent | ea84cd0842ede0ff9835bc4aae47c949ee1d1dd2 (diff) | |
download | pandoc-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.hs | 7 |
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 |