mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Support list items starting with indented code
This commit is contained in:
parent
4b3b7df710
commit
1d61f90bf9
@ -506,7 +506,12 @@ class Parsedown
|
||||
|
||||
if (preg_match('/^('.$pattern.'([ ]+|$))(.*)/', $Line['text'], $matches))
|
||||
{
|
||||
if ($matches[2] === '') {
|
||||
$contentIndent = strlen($matches[2]);
|
||||
if ($contentIndent >= 5) {
|
||||
$contentIndent -= 1;
|
||||
$matches[1] = substr($matches[1], 0, -$contentIndent);
|
||||
$matches[3] = str_repeat(' ', $contentIndent) . $matches[3];
|
||||
} elseif ($contentIndent === 0) {
|
||||
$matches[1] .= ' ';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user