diff options
| author | John MacFarlane <[email protected]> | 2025-09-19 23:17:01 +0200 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-09-19 23:18:05 +0200 |
| commit | 891e613e4a757798754754cae0c8269eb80158d8 (patch) | |
| tree | e44a5a8ee1d968086e1a58794e3d74c1dafa36f9 /src | |
| parent | f64183fbbfa478a07e66db37736acf1817319b82 (diff) | |
Docx writer: fix regression (3.8) in highlighted code.
We added DefaultHighlighting in commit 6475725 but didn't adjust the
pattern-match here.
Closes #11156.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/Docx/OpenXML.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Docx/OpenXML.hs b/src/Text/Pandoc/Writers/Docx/OpenXML.hs index f9203a1e6..c9c1bc80f 100644 --- a/src/Text/Pandoc/Writers/Docx/OpenXML.hs +++ b/src/Text/Pandoc/Writers/Docx/OpenXML.hs @@ -888,14 +888,16 @@ inlineToOpenXML' opts (Code attrs str) = do [ mknode "w:rPr" [] $ maybeToList (lookup toktype tokTypesMap) , mknode "w:t" [("xml:space","preserve")] tok ] - withTextPropM (rStyleM "Verbatim Char") - $ case writerHighlightMethod opts of - Skylighting _ -> - case highlight (writerSyntaxMap opts) formatOpenXML attrs str of + let highlighted = + case highlight (writerSyntaxMap opts) formatOpenXML attrs str of Right h -> return (map Elem h) Left msg -> do unless (T.null msg) $ report $ CouldNotHighlight msg unhighlighted + withTextPropM (rStyleM "Verbatim Char") + $ case writerHighlightMethod opts of + DefaultHighlighting -> highlighted + Skylighting _ -> highlighted _ -> unhighlighted inlineToOpenXML' opts (Note bs) = do notes <- gets stFootnotes |
