mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
improve readability
This commit is contained in:
parent
307a987cb6
commit
83d3e3dbbf
@ -111,30 +111,21 @@ class Parsedown
|
||||
|
||||
foreach ($lines as $line)
|
||||
{
|
||||
if (chop($line) === '')
|
||||
{
|
||||
if (isset($CurrentBlock))
|
||||
{
|
||||
$CurrentBlock['interrupted'] = true;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$indent = 0;
|
||||
|
||||
while (true)
|
||||
while (isset($line[$indent]) and $line[$indent] === ' ')
|
||||
{
|
||||
if (isset($line[$indent]))
|
||||
{
|
||||
if ($line[$indent] === ' ')
|
||||
{
|
||||
$indent ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else # blank line
|
||||
{
|
||||
if (isset($CurrentBlock))
|
||||
{
|
||||
$CurrentBlock['interrupted'] = true;
|
||||
}
|
||||
|
||||
continue 2;
|
||||
}
|
||||
$indent ++;
|
||||
}
|
||||
|
||||
$text = $indent > 0 ? substr($line, $indent) : $line;
|
||||
|
Loading…
Reference in New Issue
Block a user