From d1fc6fff854b4f6477a7c38632a89a7d3230eb41 Mon Sep 17 00:00:00 2001 From: MaximAL Date: Fri, 20 Mar 2015 13:14:08 +0300 Subject: [PATCH] Add ability not to expand tabs --- lib/Diff/Renderer/Html/Array.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Diff/Renderer/Html/Array.php b/lib/Diff/Renderer/Html/Array.php index 7113a174..a97e717e 100644 --- a/lib/Diff/Renderer/Html/Array.php +++ b/lib/Diff/Renderer/Html/Array.php @@ -174,7 +174,9 @@ private function getChangeExtent($fromLine, $toLine) */ private function formatLines($lines) { - $lines = array_map(array($this, 'ExpandTabs'), $lines); + if ($this->options['tabSize'] !== false) { + $lines = array_map(array($this, 'ExpandTabs'), $lines); + } $lines = array_map(array($this, 'HtmlSafe'), $lines); foreach($lines as &$line) { $line = preg_replace_callback('# ( +)|^ #', __CLASS__."::fixSpaces", $line); @@ -222,4 +224,4 @@ private function htmlSafe($string) { return htmlspecialchars($string, ENT_NOQUOTES, 'UTF-8'); } -} \ No newline at end of file +}