Skip to content

Commit 58ae44c

Browse files
committed
Multi-byte UTF-8 support fix
1 parent fc6cefb commit 58ae44c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPHtmlParser/Dom/TextNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TextNode extends AbstractNode {
3232
public function __construct($text)
3333
{
3434
// remove double spaces
35-
$text = preg_replace('/\s+/', ' ', $text);
35+
$text = mb_ereg_replace('\s+', ' ', $text);
3636

3737
$this->text = $text;
3838
$this->tag = new Tag('text');

0 commit comments

Comments
 (0)