summaryrefslogtreecommitdiff
path: root/src/HTML5
diff options
context:
space:
mode:
Diffstat (limited to 'src/HTML5')
-rw-r--r--src/HTML5/Serializer/OutputRules.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/HTML5/Serializer/OutputRules.php b/src/HTML5/Serializer/OutputRules.php
index c40858c..bb0cb45 100644
--- a/src/HTML5/Serializer/OutputRules.php
+++ b/src/HTML5/Serializer/OutputRules.php
@@ -109,11 +109,14 @@ class OutputRules implements \HTML5\Serializer\RulesInterface {
}
public function cdata($ele) {
- $this->wr('<![CDATA[')->wr($ele->data)->wr(']]>');
+ // This encodes CDATA.
+ $this->wr($ele->ownerDocument->saveXML($ele));
}
public function comment($ele) {
- $this->wr('<!--')->wr($ele->data)->wr('-->');
+ // These produce identical output.
+ //$this->wr('<!--')->wr($ele->data)->wr('-->');
+ $this->wr($ele->ownerDocument->saveXML($ele));
}
public function processorInstruction($ele) {