X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/3e641e2596a5afbbd2aa06be56f1f1193fe6021a..828c1c8420e314a2dc44506d6de84479c7cfc2b8:/lib/converter/html.php diff --git a/lib/converter/html.php b/lib/converter/html.php index 29064e5..c777cad 100644 --- a/lib/converter/html.php +++ b/lib/converter/html.php @@ -107,7 +107,7 @@ class Html extends Base } break; case XMLReader::END_ELEMENT: - array_shift($nesting, $reader->name); + array_shift($nesting); if (isset(static::$tagMap[$reader->name])) { $store .= 'name] . '>'; } else if (isset(static::$styleClassMap[$reader->name])) { @@ -134,6 +134,15 @@ class Html extends Base if ($nesting[0] != 'monospace') { $text = nl2br($text); } + $text = preg_replace_callback( + "#^\t+#m", + function ($matches) { + return str_repeat( + ' ', strlen($matches[0]) * 8 + ); + }, + $text + ); $store .= $text; break; default: