aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-06-19 23:31:17 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-06-19 23:31:17 -0700
commit557b302731411057cf12e62c87d98752f713d5d0 (patch)
tree405e0458593df5ba70bb47c794d31e1028987a0e
parent3c059dbe600608f4166b02c63d7153ace3156665 (diff)
downloadpandoc-557b302731411057cf12e62c87d98752f713d5d0.tar.gz
Docx writer: Use Compact style for empty table cells.
Otherwise we get overly tall lines when there are empty table cells and the other cells are compact. Closes #1353.
-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 4e64a79df..31e64f14e 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -571,10 +571,12 @@ blockToOpenXML opts (Table caption aligns widths headers rows) = do
[ mknode "w:tcBorders" []
$ mknode "w:bottom" [("w:val","single")] ()
, mknode "w:vAlign" [("w:val","bottom")] () ]
+ let emptyCell = [mknode "w:p" [] [mknode "w:pPr" [] $
+ [mknode "w:pStyle" [("w:val","Compact")] ()]]]
let mkcell border contents = mknode "w:tc" []
$ [ borderProps | border ] ++
if null contents
- then [mknode "w:p" [] ()]
+ then emptyCell
else contents
let mkrow border cells = mknode "w:tr" [] $ map (mkcell border) cells
let textwidth = 7920 -- 5.5 in in twips, 1/20 pt