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;
|
||||
}
|
||||
|
||||
if (strpos($line, "\t") !== false)
|
||||
{
|
||||
$parts = explode("\t", $line);
|
||||
for (
|
||||
$beforeTab = strstr($line, "\t", true);
|
||||
$beforeTab !== false;
|
||||
$beforeTab = strstr($line, "\t", true)
|
||||
) {
|
||||
$shortage = 4 - mb_strlen($beforeTab, 'utf-8') % 4;
|
||||
|
||||
$line = $parts[0];
|
||||
|
||||
unset($parts[0]);
|
||||
|
||||
foreach ($parts as $part)
|
||||
{
|
||||
$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
|
||||
|
||||
$line .= str_repeat(' ', $shortage);
|
||||
$line .= $part;
|
||||
}
|
||||
$line = $beforeTab
|
||||
. str_repeat(' ', $shortage)
|
||||
. substr($line, strlen($beforeTab) + 1)
|
||||
;
|
||||
}
|
||||
|
||||
$indent = strspn($line, ' ');
|
||||
|
Loading…
Reference in New Issue
Block a user