1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

improve readability

This commit is contained in:
Emanuil Rusev 2014-04-28 02:27:05 +03:00
parent 307a987cb6
commit 83d3e3dbbf

View File

@ -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;