From e6ff7f79861d3088f8cba2b22d86d9f75db73f6a Mon Sep 17 00:00:00 2001 From: danse Date: Mon, 12 Feb 2018 17:10:29 +0100 Subject: Docx reader: Pick table width from the longest row or header This change is intended to preserve as much of the table content as possible Closes #4360 --- test/Tests/Readers/Docx.hs | 4 ++++ test/docx/table_variable_width.docx | Bin 0 -> 10006 bytes test/docx/table_variable_width.native | 13 +++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 test/docx/table_variable_width.docx create mode 100644 test/docx/table_variable_width.native (limited to 'test') diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index 89a605bf7..9c9a8179b 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -272,6 +272,10 @@ tests = [ testGroup "inlines" "tables with one row" "docx/table_one_row.docx" "docx/table_one_row.native" + , testCompare + "tables with variable width" + "docx/table_variable_width.docx" + "docx/table_variable_width.native" , testCompare "code block" "docx/codeblock.docx" diff --git a/test/docx/table_variable_width.docx b/test/docx/table_variable_width.docx new file mode 100644 index 000000000..899357968 Binary files /dev/null and b/test/docx/table_variable_width.docx differ diff --git a/test/docx/table_variable_width.native b/test/docx/table_variable_width.native new file mode 100644 index 000000000..9d3b961df --- /dev/null +++ b/test/docx/table_variable_width.native @@ -0,0 +1,13 @@ +[Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0,0.0,0.0] + [[] + ,[] + ,[Plain [Str "h3"]] + ,[Plain [Str "h4"]] + ,[Plain [Str "h5"]]] + [[[Plain [Str "c11"]] + ,[] + ,[]] + ,[[] + ,[Plain [Str "c22"]] + ,[Plain [Str "c23"]] + ,[]]]] -- cgit v1.2.3