aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-12-13 14:09:59 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2020-12-13 14:09:59 +0100
commit00031fc809117cb436397aba83a41ca1d4056f61 (patch)
tree1474e3890fa42dcd90b1fe2b81c75c2c78420ffc /src/Text/Pandoc/Writers
parent8cf58d96e0801d8073e118f05279a9f473efcee0 (diff)
downloadpandoc-00031fc809117cb436397aba83a41ca1d4056f61.tar.gz
Docx writer: keep raw openxml strings verbatim.
Closes: #6933
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 97048e980..0174a8501 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -978,7 +978,9 @@ blockToOpenXML' opts (Para lst)
return [Elem $ mknode "w:p" [] (map Elem paraProps' ++ contents)]
blockToOpenXML' opts (LineBlock lns) = blockToOpenXML opts $ linesToPara lns
blockToOpenXML' _ b@(RawBlock format str)
- | format == Format "openxml" = return (parseXML str)
+ | format == Format "openxml" = return [
+ Text (CData CDataRaw (T.unpack str) Nothing)
+ ]
| otherwise = do
report $ BlockNotRendered b
return []
@@ -1312,7 +1314,8 @@ inlineToOpenXML' opts (Strikeout lst) =
$ inlinesToOpenXML opts lst
inlineToOpenXML' _ LineBreak = return [Elem br]
inlineToOpenXML' _ il@(RawInline f str)
- | f == Format "openxml" = return (parseXML str)
+ | f == Format "openxml" = return
+ [Text (CData CDataRaw (T.unpack str) Nothing)]
| otherwise = do
report $ InlineNotRendered il
return []