diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-06-19 23:31:17 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-06-19 23:31:17 -0700 |
commit | 557b302731411057cf12e62c87d98752f713d5d0 (patch) | |
tree | 405e0458593df5ba70bb47c794d31e1028987a0e | |
parent | 3c059dbe600608f4166b02c63d7153ace3156665 (diff) | |
download | pandoc-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.hs | 4 |
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 |