Skip to content

Commit 8777292

Browse files
committed
updated text node
1 parent d79a91e commit 8777292

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Node/Text.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public function __toString(): string
2424
if (!$this->encode) {
2525
return "<![CDATA[$this->contents]]>";
2626
}
27+
28+
if (!preg_match('~[\<\>]~', $this->contents)) {
29+
return $this->contents;
30+
}
31+
2732
return htmlentities($this->contents, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', false);
2833
}
2934
}

0 commit comments

Comments
 (0)