Skip to content

Commit

Permalink
Docx writer: Use Compact style for empty table cells.
Browse files Browse the repository at this point in the history
Otherwise we get overly tall lines when there are empty
table cells and the other cells are compact.

Closes #1353.
  • Loading branch information
jgm committed Jun 20, 2014
1 parent 3c059db commit 557b302
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Text/Pandoc/Writers/Docx.hs
Expand Up @@ -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
Expand Down

0 comments on commit 557b302

Please sign in to comment.