From 5f4deb5455d631c9fd1dd5d3ea1c96b74c06a9f7 Mon Sep 17 00:00:00 2001 From: cholonam <25772102+cholonam@users.noreply.github.com> Date: Tue, 24 Nov 2020 20:25:03 +0900 Subject: Docx writer: Fix bullets/lists indentation Fix appearance of bullets/numbered lists (the first level is slightly indented to the right instead of right on the margin). New golden files have been tested using Word 2010 on Windows 10. --- src/Text/Pandoc/Writers/Docx.hs | 6 +++--- test/docx/golden/block_quotes.docx | Bin 10052 -> 10001 bytes test/docx/golden/codeblock.docx | Bin 9904 -> 9853 bytes test/docx/golden/comments.docx | Bin 10239 -> 10188 bytes test/docx/golden/custom_style_no_reference.docx | Bin 10003 -> 9952 bytes test/docx/golden/custom_style_preserve.docx | Bin 10624 -> 10573 bytes test/docx/golden/custom_style_reference.docx | Bin 12486 -> 12434 bytes test/docx/golden/definition_list.docx | Bin 9895 -> 9844 bytes .../docx/golden/document-properties-short-desc.docx | Bin 9906 -> 9856 bytes test/docx/golden/document-properties.docx | Bin 10384 -> 10332 bytes test/docx/golden/headers.docx | Bin 10040 -> 9989 bytes test/docx/golden/image.docx | Bin 26718 -> 26667 bytes test/docx/golden/inline_code.docx | Bin 9840 -> 9789 bytes test/docx/golden/inline_formatting.docx | Bin 10010 -> 9959 bytes test/docx/golden/inline_images.docx | Bin 26776 -> 26725 bytes test/docx/golden/link_in_notes.docx | Bin 10061 -> 10010 bytes test/docx/golden/links.docx | Bin 10236 -> 10185 bytes test/docx/golden/lists.docx | Bin 10325 -> 10261 bytes test/docx/golden/lists_continuing.docx | Bin 10113 -> 10052 bytes test/docx/golden/lists_multiple_initial.docx | Bin 10208 -> 10141 bytes test/docx/golden/lists_restarting.docx | Bin 10113 -> 10053 bytes test/docx/golden/nested_anchors_in_header.docx | Bin 10199 -> 10148 bytes test/docx/golden/notes.docx | Bin 10006 -> 9955 bytes test/docx/golden/table_one_row.docx | Bin 9885 -> 9834 bytes test/docx/golden/table_with_list_cell.docx | Bin 10260 -> 10199 bytes test/docx/golden/tables.docx | Bin 10276 -> 10225 bytes test/docx/golden/track_changes_deletion.docx | Bin 9884 -> 9833 bytes test/docx/golden/track_changes_insertion.docx | Bin 9867 -> 9816 bytes test/docx/golden/track_changes_move.docx | Bin 9901 -> 9850 bytes .../golden/track_changes_scrubbed_metadata.docx | Bin 10013 -> 9962 bytes test/docx/golden/unicode.docx | Bin 9825 -> 9774 bytes test/docx/golden/verbatim_subsuper.docx | Bin 9873 -> 9822 bytes 32 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 93f7dd799..a380fd4fa 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -732,9 +732,9 @@ mkLvl marker lvl = , mknode "w:lvlText" [("w:val",lvltxt)] () , mknode "w:lvlJc" [("w:val","left")] () , mknode "w:pPr" [] - [ mknode "w:tabs" [] - $ mknode "w:tab" [("w:val","num"),("w:pos",show $ lvl * step)] () - , mknode "w:ind" [("w:left",show $ lvl * step + hang),("w:hanging",show hang)] () + [ mknode "w:ind" [ ("w:left",show $ lvl * step + step) + , ("w:hanging",show (hang :: Int)) + ] () ] ] where (fmt, lvltxt, start) = diff --git a/test/docx/golden/block_quotes.docx b/test/docx/golden/block_quotes.docx index 94eb8e811..bbc8d8de9 100644 Binary files a/test/docx/golden/block_quotes.docx and b/test/docx/golden/block_quotes.docx differ diff --git a/test/docx/golden/codeblock.docx b/test/docx/golden/codeblock.docx index ee796a1fb..e20efcab4 100644 Binary files a/test/docx/golden/codeblock.docx and b/test/docx/golden/codeblock.docx differ diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx index a19f77278..f1185da98 100644 Binary files a/test/docx/golden/comments.docx and b/test/docx/golden/comments.docx differ diff --git a/test/docx/golden/custom_style_no_reference.docx b/test/docx/golden/custom_style_no_reference.docx index c6195737f..83243ab8c 100644 Binary files a/test/docx/golden/custom_style_no_reference.docx and b/test/docx/golden/custom_style_no_reference.docx differ diff --git a/test/docx/golden/custom_style_preserve.docx b/test/docx/golden/custom_style_preserve.docx index 9997672ba..ac595cdd4 100644 Binary files a/test/docx/golden/custom_style_preserve.docx and b/test/docx/golden/custom_style_preserve.docx differ diff --git a/test/docx/golden/custom_style_reference.docx b/test/docx/golden/custom_style_reference.docx index 44900181e..5f96cc911 100644 Binary files a/test/docx/golden/custom_style_reference.docx and b/test/docx/golden/custom_style_reference.docx differ diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx index a4abcd463..005f5dbe3 100644 Binary files a/test/docx/golden/definition_list.docx and b/test/docx/golden/definition_list.docx differ diff --git a/test/docx/golden/document-properties-short-desc.docx b/test/docx/golden/document-properties-short-desc.docx index d18c110b6..5cf8db0b0 100644 Binary files a/test/docx/golden/document-properties-short-desc.docx and b/test/docx/golden/document-properties-short-desc.docx differ diff --git a/test/docx/golden/document-properties.docx b/test/docx/golden/document-properties.docx index 39d87a31a..14bfab6d4 100644 Binary files a/test/docx/golden/document-properties.docx and b/test/docx/golden/document-properties.docx differ diff --git a/test/docx/golden/headers.docx b/test/docx/golden/headers.docx index 6458ce105..416743aa1 100644 Binary files a/test/docx/golden/headers.docx and b/test/docx/golden/headers.docx differ diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx index 90362a709..ef2940f89 100644 Binary files a/test/docx/golden/image.docx and b/test/docx/golden/image.docx differ diff --git a/test/docx/golden/inline_code.docx b/test/docx/golden/inline_code.docx index 3002a2b7d..479ea65ec 100644 Binary files a/test/docx/golden/inline_code.docx and b/test/docx/golden/inline_code.docx differ diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx index c5f6ce186..ce1d16daa 100644 Binary files a/test/docx/golden/inline_formatting.docx and b/test/docx/golden/inline_formatting.docx differ diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx index 99e1e5e79..8bd57bb8c 100644 Binary files a/test/docx/golden/inline_images.docx and b/test/docx/golden/inline_images.docx differ diff --git a/test/docx/golden/link_in_notes.docx b/test/docx/golden/link_in_notes.docx index a1003b47e..2c6a638fc 100644 Binary files a/test/docx/golden/link_in_notes.docx and b/test/docx/golden/link_in_notes.docx differ diff --git a/test/docx/golden/links.docx b/test/docx/golden/links.docx index 86f0230ca..11e52c4b1 100644 Binary files a/test/docx/golden/links.docx and b/test/docx/golden/links.docx differ diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx index c64cbf46b..7667990c4 100644 Binary files a/test/docx/golden/lists.docx and b/test/docx/golden/lists.docx differ diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx index 8fbd3190c..3e8c6d2b2 100644 Binary files a/test/docx/golden/lists_continuing.docx and b/test/docx/golden/lists_continuing.docx differ diff --git a/test/docx/golden/lists_multiple_initial.docx b/test/docx/golden/lists_multiple_initial.docx index 3e632517f..05a7cf060 100644 Binary files a/test/docx/golden/lists_multiple_initial.docx and b/test/docx/golden/lists_multiple_initial.docx differ diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx index e4d75764d..f5ae4a384 100644 Binary files a/test/docx/golden/lists_restarting.docx and b/test/docx/golden/lists_restarting.docx differ diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx index 3a1286e31..d02c77271 100644 Binary files a/test/docx/golden/nested_anchors_in_header.docx and b/test/docx/golden/nested_anchors_in_header.docx differ diff --git a/test/docx/golden/notes.docx b/test/docx/golden/notes.docx index de39a4305..f7fdcbe11 100644 Binary files a/test/docx/golden/notes.docx and b/test/docx/golden/notes.docx differ diff --git a/test/docx/golden/table_one_row.docx b/test/docx/golden/table_one_row.docx index b3cf7b27d..d404878c6 100644 Binary files a/test/docx/golden/table_one_row.docx and b/test/docx/golden/table_one_row.docx differ diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx index 64b5f1d59..79c395262 100644 Binary files a/test/docx/golden/table_with_list_cell.docx and b/test/docx/golden/table_with_list_cell.docx differ diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx index af30e1fe6..df9680773 100644 Binary files a/test/docx/golden/tables.docx and b/test/docx/golden/tables.docx differ diff --git a/test/docx/golden/track_changes_deletion.docx b/test/docx/golden/track_changes_deletion.docx index 97c060915..bb73b82f6 100644 Binary files a/test/docx/golden/track_changes_deletion.docx and b/test/docx/golden/track_changes_deletion.docx differ diff --git a/test/docx/golden/track_changes_insertion.docx b/test/docx/golden/track_changes_insertion.docx index a1f141043..7df484aaa 100644 Binary files a/test/docx/golden/track_changes_insertion.docx and b/test/docx/golden/track_changes_insertion.docx differ diff --git a/test/docx/golden/track_changes_move.docx b/test/docx/golden/track_changes_move.docx index fbfd8ec59..d717b93ab 100644 Binary files a/test/docx/golden/track_changes_move.docx and b/test/docx/golden/track_changes_move.docx differ diff --git a/test/docx/golden/track_changes_scrubbed_metadata.docx b/test/docx/golden/track_changes_scrubbed_metadata.docx index 50951f0d2..791182db2 100644 Binary files a/test/docx/golden/track_changes_scrubbed_metadata.docx and b/test/docx/golden/track_changes_scrubbed_metadata.docx differ diff --git a/test/docx/golden/unicode.docx b/test/docx/golden/unicode.docx index 4daf635e9..b64a7b58e 100644 Binary files a/test/docx/golden/unicode.docx and b/test/docx/golden/unicode.docx differ diff --git a/test/docx/golden/verbatim_subsuper.docx b/test/docx/golden/verbatim_subsuper.docx index 984f16abd..b5116d1a8 100644 Binary files a/test/docx/golden/verbatim_subsuper.docx and b/test/docx/golden/verbatim_subsuper.docx differ -- cgit v1.2.3