summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Docx.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/Docx.hs
parentea84cd0842ede0ff9835bc4aae47c949ee1d1dd2 (diff)
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/Docx.hs')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 5e4fe7731..fcc8551a4 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -1181,7 +1181,8 @@ inlineToOpenXML' opts (Code attrs str) = do
withTextProp (rCustomStyle "VerbatimChar")
$ if isNothing (writerHighlightStyle opts)
then unhighlighted
- else case highlight formatOpenXML attrs str of
+ else case highlight (writerSyntaxMap opts)
+ formatOpenXML attrs str of
Right h -> return h
Left msg -> do
unless (null msg) $ report $ CouldNotHighlight msg