mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Remove use of array
This commit is contained in:
parent
c45e41950f
commit
3ea08140b6
@ -182,21 +182,17 @@ class Parsedown
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($line, "\t") !== false)
|
for (
|
||||||
{
|
$beforeTab = strstr($line, "\t", true);
|
||||||
$parts = explode("\t", $line);
|
$beforeTab !== false;
|
||||||
|
$beforeTab = strstr($line, "\t", true)
|
||||||
|
) {
|
||||||
|
$shortage = 4 - mb_strlen($beforeTab, 'utf-8') % 4;
|
||||||
|
|
||||||
$line = $parts[0];
|
$line = $beforeTab
|
||||||
|
. str_repeat(' ', $shortage)
|
||||||
unset($parts[0]);
|
. substr($line, strlen($beforeTab) + 1)
|
||||||
|
;
|
||||||
foreach ($parts as $part)
|
|
||||||
{
|
|
||||||
$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
|
|
||||||
|
|
||||||
$line .= str_repeat(' ', $shortage);
|
|
||||||
$line .= $part;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$indent = strspn($line, ' ');
|
$indent = strspn($line, ' ');
|
||||||
|
Loading…
Reference in New Issue
Block a user