From c440c91af5388b6c213103a44c61ca4b7ff80e88 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Mon, 9 Apr 2018 16:28:25 +0100 Subject: [PATCH 1/2] Add failing test case --- test/data/simple_table.html | 8 +++++++- test/data/simple_table.md | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/data/simple_table.html b/test/data/simple_table.html index f6f7aab..b74a2ec 100644 --- a/test/data/simple_table.html +++ b/test/data/simple_table.html @@ -66,4 +66,10 @@ cell 2.1 - \ No newline at end of file + +
+

Not a table, we haven't ended the paragraph: +header 1 | header 2 +-------- | -------- +cell 1.1 | cell 1.2 +cell 2.1 | cell 2.2

\ No newline at end of file diff --git a/test/data/simple_table.md b/test/data/simple_table.md index f767257..42eff5a 100644 --- a/test/data/simple_table.md +++ b/test/data/simple_table.md @@ -22,4 +22,12 @@ cell 2.1 header 1 -------| cell 1.1 -cell 2.1 \ No newline at end of file +cell 2.1 + +--- + +Not a table, we haven't ended the paragraph: +header 1 | header 2 +-------- | -------- +cell 1.1 | cell 1.2 +cell 2.1 | cell 2.2 \ No newline at end of file From cb33daf0e6f694076a3718b36c06c570b4b58ba7 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Mon, 9 Apr 2018 16:37:32 +0100 Subject: [PATCH 2/2] Assert table header does not contain new lines --- Parsedown.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Parsedown.php b/Parsedown.php index 9e02e16..5baf6ab 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -883,6 +883,7 @@ class Parsedown strpos($Block['element']['handler']['argument'], '|') === false and strpos($Line['text'], '|') === false and strpos($Line['text'], ':') === false + or strpos($Block['element']['handler']['argument'], "\n") !== false ) { return; }