From 5258927ddc45e17254ce510d69baeb636a505500 Mon Sep 17 00:00:00 2001 From: MaximBobylev <54582196+MaximBobylev@users.noreply.github.com> Date: Wed, 29 Dec 2021 18:08:16 +0300 Subject: [PATCH] fix issue #746 The problem described in the the issue could be simplified to parsing error in case of the following table ``` | header1 | header2 | | --- | --- | | \`\`\`a\`\`\` | \`\`\`b\`\`\` | ``` Instead of parsing values A and B into separate columns, these values are being concatinated into first column. PR adds one alternative into column value regex, which provides correct parsing of triple backtics --- Parsedown.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index ae0cbdecd..e65cd2142 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -1033,7 +1033,7 @@ protected function blockTableContinue($Line, array $Block) $row = trim($row); $row = trim($row, '|'); - preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]++`|`)++/', $row, $matches); + preg_match_all('/(?:(\\\\[|])|`{3,3}.*?`{3,3}|[^|`]|`[^`]++`|`)++/', $row, $matches); $cells = array_slice($matches[0], 0, count($Block['alignments']));