mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
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
This commit is contained in:
parent
6598f3860c
commit
5258927ddc
@ -1033,7 +1033,7 @@ class Parsedown
|
||||
$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']));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user