From 3cd21c5f6e1b9ddb1e6ff35d418f6df25c56cb63 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 29 Dec 2020 08:44:11 -0800 Subject: Improve fix to #6983. If we have a paragraph then a bookmarkEnd, we don't need to insert the empty paragraph (and in fact it alters the spacing). Closes #6983. --- src/Text/Pandoc/Writers/Docx.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 13c4edb3c..65946ec88 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -1017,7 +1017,9 @@ blockToOpenXML' opts (Table _ blkCapt specs thead tbody tfoot) = do es <- withParaProp (alignmentFor al) $ blocksToOpenXML opts cell return $ case reverse (onlyElems es) of - e:_ | qName (elName e) == "p" -> es + b:e:_ | qName (elName b) == "bookmarkEnd" + , qName (elName e) == "p" -> es + e:_ | qName (elName e) == "p" -> es _ -> es ++ [Elem $ mknode "w:p" [] ()] headers' <- mapM cellToOpenXML $ zip aligns headers rows' <- mapM (mapM cellToOpenXML . zip aligns) rows -- cgit v1.2.3