Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
improve by recurse the str_replace
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Mar 2, 2016
1 parent b80728b commit 1dc0d61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BeautifyHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ function beautify($buffer){
$indentionLevel++;
}
$buffer = implode("\n",$cleanContent); // write indented lines back to buffer
$buffer = str_replace(array_keys($this->tagsToIgnoreBlocks), $this->tagsToIgnoreBlocks, $buffer); // add blocks, which should not be processed
do{
$buffer = str_replace(array_keys($this->tagsToIgnoreBlocks), array_values($this->tagsToIgnoreBlocks), $buffer, $replaced); // add blocks, which should not be processed
}
while($replaced);
return $buffer;
}
}

0 comments on commit 1dc0d61

Please sign in to comment.