From 00031fc809117cb436397aba83a41ca1d4056f61 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 13 Dec 2020 14:09:59 +0100 Subject: Docx writer: keep raw openxml strings verbatim. Closes: #6933 --- src/Text/Pandoc/Writers/Docx.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers') 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 [] -- cgit v1.2.3