Skip to content

Commit 5b14617

Browse files
author
Christoph Singer
committed
Bugfix for indenting with customized indent_characters option
2 parents a7c710e + 340ede7 commit 5b14617

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PrettyMin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ protected function indentRecursive(\DOMNode $currentNode, $depth) {
335335
// If children have been indented, then the closing tag
336336
// of the current node must also be indented.
337337
if ($currentNode->lastChild && ($currentNode->lastChild->nodeType == XML_CDATA_SECTION_NODE || $currentNode->lastChild->nodeType == XML_TEXT_NODE) && preg_match('/\n\s?$/', $currentNode->lastChild->textContent)) {
338-
$currentNode->lastChild->nodeValue = preg_replace('/\n\s?$/', "\n" . str_repeat("\t", $depth), $currentNode->lastChild->nodeValue);
338+
$currentNode->lastChild->nodeValue = preg_replace('/\n\s?$/', "\n" . str_repeat($indent_characters, $depth), $currentNode->lastChild->nodeValue);
339339
} else {
340-
$textNode = $currentNode->ownerDocument->createTextNode("\n" . str_repeat("\t", $depth));
340+
$textNode = $currentNode->ownerDocument->createTextNode("\n" . str_repeat($indent_characters, $depth));
341341
$currentNode->appendChild($textNode);
342342
}
343343
}

0 commit comments

Comments
 (0)