1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
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:
MaximBobylev 2021-12-29 18:08:16 +03:00 committed by GitHub
parent 6598f3860c
commit 5258927ddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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']));