aboutsummaryrefslogtreecommitdiff
path: root/lib/converter
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2018-10-07 13:42:09 +0200
committerChristian Weiske <cweiske@cweiske.de>2018-10-07 13:42:09 +0200
commit1105322aac9cc8e71eafbf5a5eea8e709c8c77ce (patch)
treebb2026db2adb7e1b7ab7396a047f64bbc17d0210 /lib/converter
parent076545376eb1ce47de2135373fb858db5a411e8c (diff)
downloadgrauphel-1105322aac9cc8e71eafbf5a5eea8e709c8c77ce.tar.gz
grauphel-1105322aac9cc8e71eafbf5a5eea8e709c8c77ce.zip
Display tab-based line indentation in HTML
Resolves: https://github.com/cweiske/grauphel/issues/60
Diffstat (limited to 'lib/converter')
-rw-r--r--lib/converter/html.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/converter/html.php b/lib/converter/html.php
index 11cf105..c777cad 100644
--- a/lib/converter/html.php
+++ b/lib/converter/html.php
@@ -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(
+ '&#160;', strlen($matches[0]) * 8
+ );
+ },
+ $text
+ );
$store .= $text;
break;
default: