From 74bd5a4f4758d06be43bc807f6f9b82a20970a0b Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Fri, 2 Oct 2020 18:30:05 +0200 Subject: Docx writer: better handle list items whose contents are lists (#6522) If the first element of a bulleted or ordered list is another list, then that first item will disappear if the target format is docx. This changes the docx writer so that it prepends an empty string for those cases. With this, no items will disappear. Closes #5948. --- test/Tests/Writers/Docx.hs | 5 +++++ test/docx/golden/lists_multiple_initial.docx | Bin 0 -> 10208 bytes test/docx/lists_multiple_initial.native | 8 ++++++++ 3 files changed, 13 insertions(+) create mode 100644 test/docx/golden/lists_multiple_initial.docx create mode 100644 test/docx/lists_multiple_initial.native (limited to 'test') diff --git a/test/Tests/Writers/Docx.hs b/test/Tests/Writers/Docx.hs index 9e1414c40..ccd31642a 100644 --- a/test/Tests/Writers/Docx.hs +++ b/test/Tests/Writers/Docx.hs @@ -83,6 +83,11 @@ tests = [ testGroup "inlines" def "docx/lists_restarting.native" "docx/golden/lists_restarting.docx" + , docxTest + "lists with multiple initial list levels" + def + "docx/lists_multiple_initial.native" + "docx/golden/lists_multiple_initial.docx" , docxTest "definition lists" def diff --git a/test/docx/golden/lists_multiple_initial.docx b/test/docx/golden/lists_multiple_initial.docx new file mode 100644 index 000000000..3e632517f Binary files /dev/null and b/test/docx/golden/lists_multiple_initial.docx differ diff --git a/test/docx/lists_multiple_initial.native b/test/docx/lists_multiple_initial.native new file mode 100644 index 000000000..91efdfd17 --- /dev/null +++ b/test/docx/lists_multiple_initial.native @@ -0,0 +1,8 @@ +[OrderedList (1,Decimal,Period) + [[OrderedList (1,LowerAlpha,TwoParens) + [[Para [Str "foo"]] + ,[Para [Str "bar"]]]]] +,BulletList + [[BulletList + [[Para [Str "foo"]] + ,[Para [Str "bar"]]]]]] -- cgit v1.2.3