From 1405e7b7091dedb50578c9e0cafd62f2c77ca689 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Sun, 29 Jun 2014 23:37:00 -0400 Subject: Docx reader: Add tests for hanging indent handline. We want to treat it as a plain paragraph if the hanging amount is greater to or equal to the left indent---i.e., if the first line has zero indentation. But we still want it to be a block quote if it starts to the right of the margin. Someone might format verse with wrapping lines with a hanging indent, for example. --- tests/Tests/Readers/Docx.hs | 4 ++++ tests/docx.hanging_indent.docx | Bin 0 -> 29924 bytes tests/docx.hanging_indent.native | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 tests/docx.hanging_indent.docx create mode 100644 tests/docx.hanging_indent.native (limited to 'tests') diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index 8c51217cf..a379bbf23 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -112,6 +112,10 @@ tests = [ testGroup "inlines" "blockquotes (parsing indent as blockquote)" "docx.block_quotes.docx" "docx.block_quotes_parse_indent.native" + , testCompare + "hanging indents" + "docx.hanging_indent.docx" + "docx.hanging_indent.native" , testCompare "tables" "docx.tables.docx" diff --git a/tests/docx.hanging_indent.docx b/tests/docx.hanging_indent.docx new file mode 100644 index 000000000..6f62dc731 Binary files /dev/null and b/tests/docx.hanging_indent.docx differ diff --git a/tests/docx.hanging_indent.native b/tests/docx.hanging_indent.native new file mode 100644 index 000000000..138a6967f --- /dev/null +++ b/tests/docx.hanging_indent.native @@ -0,0 +1,3 @@ +[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "hanging",Space,Str "indent,",Space,Str "with",Space,Str "the",Space,Str "left",Space,Str "side",Space,Str "set",Space,Str "to",Space,Str "the",Space,Str "left",Space,Str "margin,",Space,Str "and",Space,Str "it",Space,Str "wraps",Space,Str "around",Space,Str "the",Space,Str "line."] +,BlockQuote + [Para [Str "Five",Space,Str "years",Space,Str "have",Space,Str "passed,",Space,Str "five",Space,Str "summers",Space,Str "with",Space,Str "the",Space,Str "length"]]] -- cgit v1.2.3