From 246ed7785e93cc1ebf59a2f15af61472d20efca0 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Mon, 28 Oct 2013 16:24:00 -0600 Subject: Changed serialization for CDATA and comments. Change to comments does not seem to produce different output under any cases. See Issue #19. --- src/HTML5/Serializer/OutputRules.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/HTML5') 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('wr($ele->data)->wr(']]>'); + // This encodes CDATA. + $this->wr($ele->ownerDocument->saveXML($ele)); } public function comment($ele) { - $this->wr(''); + // These produce identical output. + //$this->wr(''); + $this->wr($ele->ownerDocument->saveXML($ele)); } public function processorInstruction($ele) { -- cgit v1.2.3