summaryrefslogtreecommitdiff
path: root/src/HTML5
diff options
context:
space:
mode:
authorMatt Butcher <[email protected]>2013-10-28 16:24:00 -0600
committerMatt Butcher <[email protected]>2013-10-28 16:24:00 -0600
commit246ed7785e93cc1ebf59a2f15af61472d20efca0 (patch)
tree0931a290e672c23562a9cec8bb7baa1f0ea5f444 /src/HTML5
parent772612d7ee7cf1ab9ab00f34de852bc1f368d2ba (diff)
Changed serialization for CDATA and comments.
Change to comments does not seem to produce different output under any cases. See Issue #19.
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) {