1
0
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:
Aidan Woods 2018-04-09 00:46:26 +01:00
parent c45e41950f
commit 3ea08140b6
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -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, ' ');