Skip to content

Commit

Permalink
Added semicolon after &#10 for linebreak preservation.
Browse files Browse the repository at this point in the history
fixes #62
  • Loading branch information
paquettg committed Apr 5, 2016
1 parent 20bcd65 commit d68e966
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PHPHtmlParser/Dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ protected function clean($str)
// clean out the \n\r
$replace = ' ';
if ($this->options->get('preserveLineBreaks')) {
$replace = '&#10';
$replace = '
';
}
$str = str_replace(["\r\n", "\r", "\n"], $replace, $str);

Expand Down
2 changes: 1 addition & 1 deletion src/PHPHtmlParser/Dom/TextNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct($text)
$text = mb_ereg_replace('\s+', ' ', $text);

// restore line breaks
$text = str_replace('&#10', "\n", $text);
$text = str_replace('
', "\n", $text);

$this->text = $text;
$this->tag = new Tag('text');
Expand Down

0 comments on commit d68e966

Please sign in to comment.