aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-12-29 08:44:11 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-12-29 08:44:43 -0800
commit3cd21c5f6e1b9ddb1e6ff35d418f6df25c56cb63 (patch)
tree52926646f7a14a33ad2e2b91ec8e083dc4672c3e /src/Text/Pandoc
parent55f9b59af181f52f20f3e9eb8f9df3046d3cb536 (diff)
downloadpandoc-3cd21c5f6e1b9ddb1e6ff35d418f6df25c56cb63.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs4
1 files changed, 3 insertions, 1 deletions
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