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)
|
foreach ($lines as $line)
|
||||||
{
|
{
|
||||||
$indent = 0;
|
if (chop($line) === '')
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
if (isset($line[$indent]))
|
|
||||||
{
|
|
||||||
if ($line[$indent] === ' ')
|
|
||||||
{
|
|
||||||
$indent ++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else # blank line
|
|
||||||
{
|
{
|
||||||
if (isset($CurrentBlock))
|
if (isset($CurrentBlock))
|
||||||
{
|
{
|
||||||
$CurrentBlock['interrupted'] = true;
|
$CurrentBlock['interrupted'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue 2;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$indent = 0;
|
||||||
|
|
||||||
|
while (isset($line[$indent]) and $line[$indent] === ' ')
|
||||||
|
{
|
||||||
|
$indent ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = $indent > 0 ? substr($line, $indent) : $line;
|
$text = $indent > 0 ? substr($line, $indent) : $line;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user