aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-11-19 11:25:56 -0800
committerJohn MacFarlane <[email protected]>2022-11-19 11:25:56 -0800
commitf14ff27bd8be349114b46cc08ed88f0fbbc7ace2 (patch)
tree23c2380f7b4bab8a847e079a1f63251d47e5d234
parentceec8330398ea12bab68fdf351e63c6c1ea2f123 (diff)
Docx writer: render Span with class `mark` as highlighted.
Currently yellow is hardcoded. Maybe think about using a style. See #7743.
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 9abe04b7a..3da9a000f 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -1114,6 +1114,9 @@ inlineToOpenXML' _ (Str str) =
map Elem <$> formattedString str
inlineToOpenXML' opts Space = inlineToOpenXML opts (Str " ")
inlineToOpenXML' opts SoftBreak = inlineToOpenXML opts (Str " ")
+inlineToOpenXML' opts (Span ("",["mark"],[]) ils) =
+ withTextProp (mknode "w:highlight" [("w:val","yellow")] ()) $
+ inlinesToOpenXML opts ils
inlineToOpenXML' opts (Span ("",["csl-block"],[]) ils) =
inlinesToOpenXML opts ils
inlineToOpenXML' opts (Span ("",["csl-left-margin"],[]) ils) =