summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2024-02-03 22:50:55 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2024-02-03 22:50:55 -0800
commit0706c7a285fb905345276370da17ad74eefa7135 (patch)
tree41fe7db5a01c604f45164e4caff99121cadea58d /src
parent03bb426a4a65918bfd6fbd63d5bb32a657df5568 (diff)
Docx writer: restore ability to center-justify table.
The fix to #5947 caused all tables to be left indented. This was necessary to avoid extra indentation in table cells when a table appeared in a list item. This change makes the changes conditional, so that they only affect tables in list items. Closes #9393.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Docx/Table.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docx/Table.hs b/src/Text/Pandoc/Writers/Docx/Table.hs
index 08ff295c9..1e84965e9 100644
--- a/src/Text/Pandoc/Writers/Docx/Table.hs
+++ b/src/Text/Pandoc/Writers/Docx/Table.hs
@@ -114,8 +114,8 @@ tableToOpenXML opts blocksToOpenXML gridTable = do
let tbl = mknode "w:tbl" []
( mknode "w:tblPr" []
( [ mknode "w:tblStyle" [("w:val","Table")] (),
- mknode "w:tblW" tblWattr (),
- mknode "w:jc" [("w:val","left")] () ] ++
+ mknode "w:tblW" tblWattr () ] ++
+ [ mknode "w:jc" [("w:val","left")] () | indent > 0 ] ++
[ mknode "w:tblInd" [("w:w", tshow indent),("w:type","dxa")] ()
| indent > 0 ] ++
[ mknode "w:tblLayout" [("w:type", "fixed")] () | hasWidths ] ++