From 9cc2dc62e7b1e9012572c5bd461a5ed5e6aa5f1a Mon Sep 17 00:00:00 2001 From: Microservice Date: Tue, 15 May 2018 15:25:59 +0200 Subject: [PATCH] Update format.php --- format.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/format.php b/format.php index e8d5fad..e931413 100644 --- a/format.php +++ b/format.php @@ -10,6 +10,7 @@ class Format private $in_content = FALSE; private $inline_tag = FALSE; private $input_index = 0; + private $indentation = "\t"; public function HTML($input) { @@ -40,7 +41,7 @@ public function HTML($input) $this->parse_tag(); } elseif ( ! $this->in_content) { if ( ! $this->inline_tag) { - $this->output .= "\n" . str_repeat("\t", $this->tabs); + $this->output .= "\n" . str_repeat($this->indentation, $this->tabs); } $this->in_content = TRUE; } @@ -86,19 +87,19 @@ private function parse_inner_inline_tag() private function parse_tag() { if ($this->is_comment()) { - $this->output .= "\n" . str_repeat("\t", $this->tabs); + $this->output .= "\n" . str_repeat($this->indentation, $this->tabs); $this->in_comment = TRUE; } elseif ($this->is_end_tag()) { $this->in_tag = TRUE; $this->inline_tag = FALSE; $this->decrement_tabs(); if ( ! $this->is_inline_tag() AND ! $this->is_tag_empty()) { - $this->output .= "\n" . str_repeat("\t", $this->tabs); + $this->output .= "\n" . str_repeat($this->indentation, $this->tabs); } } else { $this->in_tag = TRUE; if ( ! $this->in_content AND ! $this->inline_tag) { - $this->output .= "\n" . str_repeat("\t", $this->tabs); + $this->output .= "\n" . str_repeat($this->indentation, $this->tabs); } if ( ! $this->is_closed_tag()) { $this->tabs++;