aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-03-09 11:46:00 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-03-09 11:46:00 -0800
commit2b55b76ebec87f4d35b2e641e054bd6dfc74be09 (patch)
tree1ea7aedc0b313669668f75efb9d29f78b51f83d3 /tests
parent54a68616d7f9259840fd8a884d806782a73236a9 (diff)
downloadpandoc-2b55b76ebec87f4d35b2e641e054bd6dfc74be09.tar.gz
Markdown reader: Improved pipe table parsing.
Fixes #2765. Added test case.
Diffstat (limited to 'tests')
-rw-r--r--tests/pipe-tables.native16
-rw-r--r--tests/pipe-tables.txt8
2 files changed, 23 insertions, 1 deletions
diff --git a/tests/pipe-tables.native b/tests/pipe-tables.native
index 6cd37f6ff..63c2c17bc 100644
--- a/tests/pipe-tables.native
+++ b/tests/pipe-tables.native
@@ -98,4 +98,18 @@
,Para [Str "Pipe",Space,Str "table",Space,Str "with",Space,Str "no",Space,Str "body:"]
,Table [] [AlignDefault] [0.0]
[[Plain [Str "Header"]]]
- []]
+ []
+,Para [Str "Pipe",Space,Str "table",Space,Str "with",Space,Str "tricky",Space,Str "cell",Space,Str "contents",Space,Str "(see",Space,Str "#2765):"]
+,Table [] [AlignLeft,AlignRight,AlignRight] [0.0,0.0,0.0]
+ [[]
+ ,[Plain [Str "IP_gene8-_1st"]]
+ ,[Plain [Str "IP_gene8+_1st"]]]
+ [[[Plain [Str "IP_gene8-_1st"]]
+ ,[Plain [Str "1.0000000"]]
+ ,[Plain [Str "0.4357325"]]]
+ ,[[Plain [Str "IP_gene8+_1st"]]
+ ,[Plain [Str "0.4357325"]]
+ ,[Plain [Str "1.0000000"]]]
+ ,[[Plain [Str "foo",Code ("",[],[]) "bar|baz"]]
+ ,[Plain [Str "and|escaped"]]
+ ,[Plain [Str "3.0000000"]]]]]
diff --git a/tests/pipe-tables.txt b/tests/pipe-tables.txt
index e93f64af9..c27c71113 100644
--- a/tests/pipe-tables.txt
+++ b/tests/pipe-tables.txt
@@ -72,3 +72,11 @@ Pipe table with no body:
| Header |
| ------ |
+Pipe table with tricky cell contents (see #2765):
+
+| | IP_gene8-_1st| IP_gene8+_1st|
+|:--------------|-------------:|-------------:|
+|IP_gene8-_1st | 1.0000000| 0.4357325|
+|IP_gene8+_1st | 0.4357325| 1.0000000|
+|foo`bar|baz` | and\|escaped | 3.0000000|
+