git.iko.soy/typeable/pandoc
on master help sign in
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.

commit557b302731411057cf12e62c87d98752f713d5d0 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 19 Jun 2014, 23:31 (12 years ago) parent3c059db
1 file changed+3−1
src/Text/Pandoc/Writers/Docx.hs+3−1
src/Text/Pandoc/Writers/Docx.hs+3−1
@@ -571,10 +571,12 @@ blockToOpenXML opts (Table caption aligns widths headers rows) = do
571571 [ mknode "w:tcBorders" []
572572 $ mknode "w:bottom" [("w:val","single")] ()
573573 , mknode "w:vAlign" [("w:val","bottom")] () ]
574+ let emptyCell = [mknode "w:p" [] [mknode "w:pPr" [] $
575+ [mknode "w:pStyle" [("w:val","Compact")] ()]]]
574576 let mkcell border contents = mknode "w:tc" []
575577 $ [ borderProps | border ] ++
576578 if null contents
577− then [mknode "w:p" [] ()]
579+ then emptyCell
578580 else contents
579581 let mkrow border cells = mknode "w:tr" [] $ map (mkcell border) cells
580582 let textwidth = 7920 -- 5.5 in in twips, 1/20 pt