Display tab-based line indentation in HTML
[grauphel.git] / lib / converter / html.php
index 11cf105ceb2a01c1928ff9e9f4137c0bc309688d..c777cadd921425e243a0d15fffdbd695ae2e1195 100644 (file)
@@ -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: