From 8af15ab345bb0790cc3442722673d9da9f23a79c Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 17 Sep 2021 16:05:06 +0100 Subject: pptx: Fix list level numbering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In PowerPoint, the content of a top-level list is at the same level as the content of a top-level paragraph – the only difference is that a list style has been applied. At the moment, the pptx writer increments the paragraph level on each list, turning what should be top-level lists into second-level lists. This commit changes that logic, only incrementing the paragraph level on continuation paragraphs of lists. - Fixes https://github.com/jgm/pandoc/issues/4828 - Fixes https://github.com/jgm/pandoc/issues/4663 --- test/Tests/Writers/Powerpoint.hs | 4 ++++ test/pptx/code-custom/output.pptx | Bin 29817 -> 29807 bytes test/pptx/code-custom/templated.pptx | Bin 42884 -> 42877 bytes test/pptx/code/output.pptx | Bin 29815 -> 29806 bytes test/pptx/code/templated.pptx | Bin 42882 -> 42876 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77169 -> 77136 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90280 -> 90251 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75411 -> 75386 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88518 -> 88495 bytes test/pptx/list-level/input.native | 20 ++++++++++++++++++++ test/pptx/list-level/output.pptx | Bin 0 -> 28635 bytes test/pptx/list-level/templated.pptx | Bin 0 -> 41701 bytes test/pptx/lists/output.pptx | Bin 28664 -> 28657 bytes test/pptx/lists/templated.pptx | Bin 41729 -> 41724 bytes test/pptx/pauses/without-incremental/output.pptx | Bin 0 -> 50083 bytes test/pptx/pauses/without-incremental/templated.pptx | Bin 0 -> 63157 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31129 -> 31123 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44195 -> 44191 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51494 -> 51486 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64558 -> 64552 bytes test/pptx/start-numbering-at/output.pptx | Bin 28626 -> 28620 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41691 -> 41686 bytes 22 files changed, 24 insertions(+) create mode 100644 test/pptx/list-level/input.native create mode 100644 test/pptx/list-level/output.pptx create mode 100644 test/pptx/list-level/templated.pptx create mode 100644 test/pptx/pauses/without-incremental/output.pptx create mode 100644 test/pptx/pauses/without-incremental/templated.pptx (limited to 'test') diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 84bdd7476..f3663efbb 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -66,6 +66,10 @@ tests = let def "pptx/start-numbering-at/input.native" "pptx/start-numbering-at/output.pptx" + , pptxTests "List continuation paragraph indentation" + def + "pptx/list-level/input.native" + "pptx/list-level/output.pptx" , pptxTests "tables" def "pptx/tables/input.native" diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index ded8f1125..6c7a1a9ab 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 8bb0df1ff..116865c1f 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index e700bc268..8fd00ff74 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 44f34cd64..0d7db048f 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 1ca1dbf17..82f5f926f 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index 4ddf6bb75..e8482b25f 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 6f7261ba3..62e66e1fe 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index ca5c9fdab..ac7be9564 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/list-level/input.native b/test/pptx/list-level/input.native new file mode 100644 index 000000000..e0b36b8e5 --- /dev/null +++ b/test/pptx/list-level/input.native @@ -0,0 +1,20 @@ +[Header 1 ("slide",[],[]) [Str "Slide"] +,BulletList + [[Para [Str "Top-level"] + ,Para [Str "With",Space,Str "continuation",Space,Str "paragraph"]] + ,[Para [Str "Then:"] + ,BulletList + [[Plain [Str "nested"]] + ,[Plain [Str "list"]] + ,[Plain [Str "items"]]]]] +,Header 1 ("slide-1",[],[]) [Str "Slide"] +,Para [Str "Paragraph."] +,OrderedList (1,Decimal,Period) + [[Para [Str "Top-level"] + ,Para [Str "Continuation"] + ,OrderedList (1,Decimal,Period) + [[Para [Str "Sub-list"] + ,Para [Str "With",Space,Str "Continuation"]] + ,[Para [Str "(still",Space,Str "sub-list)"]]]] + ,[Para [Str "(back",Space,Str "to",Space,Str "top-level)"]]] +,Para [Str "Paragraph."]] diff --git a/test/pptx/list-level/output.pptx b/test/pptx/list-level/output.pptx new file mode 100644 index 000000000..5e3506958 Binary files /dev/null and b/test/pptx/list-level/output.pptx differ diff --git a/test/pptx/list-level/templated.pptx b/test/pptx/list-level/templated.pptx new file mode 100644 index 000000000..8853a3082 Binary files /dev/null and b/test/pptx/list-level/templated.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 94a424f42..e23f47218 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 52097489f..290b5b519 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/pauses/without-incremental/output.pptx b/test/pptx/pauses/without-incremental/output.pptx new file mode 100644 index 000000000..9085db330 Binary files /dev/null and b/test/pptx/pauses/without-incremental/output.pptx differ diff --git a/test/pptx/pauses/without-incremental/templated.pptx b/test/pptx/pauses/without-incremental/templated.pptx new file mode 100644 index 000000000..6662e2451 Binary files /dev/null and b/test/pptx/pauses/without-incremental/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index 788cdf148..f2660ef93 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index d11744079..0a2bdb857 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 99110d3ca..b54ba4465 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index daf8e2175..3b272ab1b 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index bc74ec599..ecfc6901a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 4f191a06e..f3f46ef30 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ -- cgit v1.2.3