From 1105322aac9cc8e71eafbf5a5eea8e709c8c77ce Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 7 Oct 2018 13:42:09 +0200 Subject: Display tab-based line indentation in HTML Resolves: https://github.com/cweiske/grauphel/issues/60 --- lib/converter/html.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/converter/html.php') 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( + ' ', strlen($matches[0]) * 8 + ); + }, + $text + ); $store .= $text; break; default: -- cgit v1.2.3