aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-08-29 08:35:59 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-08-29 08:35:59 -0400
commitfcbb37c8f3b28ae0889041030f37e7c730751bcd (patch)
treedfeef9f662f2da6c896b52601ed17d57b1905bd0 /tests
parent95734b2951e54f9e92f06df1deff79f5fe6f790a (diff)
downloadpandoc-fcbb37c8f3b28ae0889041030f37e7c730751bcd.tar.gz
Docx reader: test for nested anchor spans in header
This ensures that anchor spans in header with content (or with other anchor spans inside) will resolve to links to a header id properly.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Docx.hs4
-rw-r--r--tests/docx/nested_anchors_in_header.docxbin0 -> 17535 bytes
-rw-r--r--tests/docx/nested_anchors_in_header.native10
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs
index a9a9094f1..8ae0532e4 100644
--- a/tests/Tests/Readers/Docx.hs
+++ b/tests/Tests/Readers/Docx.hs
@@ -182,6 +182,10 @@ tests = [ testGroup "inlines"
"docx/already_auto_ident.docx"
"docx/already_auto_ident.native"
, testCompare
+ "nested anchor spans in header"
+ "docx/nested_anchors_in_header.docx"
+ "docx/nested_anchors_in_header.native"
+ , testCompare
"single numbered item not made into list"
"docx/numbered_header.docx"
"docx/numbered_header.native"
diff --git a/tests/docx/nested_anchors_in_header.docx b/tests/docx/nested_anchors_in_header.docx
new file mode 100644
index 000000000..ddebb7ff4
--- /dev/null
+++ b/tests/docx/nested_anchors_in_header.docx
Binary files differ
diff --git a/tests/docx/nested_anchors_in_header.native b/tests/docx/nested_anchors_in_header.native
new file mode 100644
index 000000000..e2b6eb1ef
--- /dev/null
+++ b/tests/docx/nested_anchors_in_header.native
@@ -0,0 +1,10 @@
+[Header 1 ("short-instructions",[],[]) [Str "Short",Space,Str "instructions"]
+,Para [Link ("",[],[]) [Str "Open",Space,Str "remote",Space,Str "folder"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening","")]
+,Para [Str "Do",Space,Str "staff"]
+,Para [Link ("",[],[]) [Str "Close",Space,Str "remote",Space,Str "folder"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing","")]
+,Header 1 ("some-instructions",[],[]) [Str "Some",Space,Str "instructions"]
+,Para [Str "Lines"]
+,Header 2 ("remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening",[],[]) [Str "Remote",Space,Str "folder",Space,Str "or",Space,Str "longlonglonglonglong",Space,Str "file",Space,Str "with",Space,Str "manymanymanymany",Space,Str "letters",Space,Str "inside",Space,Str "opening"]
+,Para [Str "Open",Space,Str "folder"]
+,Header 2 ("remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing",[],[]) [Str "Remote",Space,Str "folder",Space,Str "or",Space,Str "longlonglonglonglong",Space,Str "file",Space,Str "with",Space,Str "manymanymanymany",Space,Str "letters",Space,Str "inside",Space,Str "closing"]
+,Para [Str "Close",Space,Str "folder"]]