From 6242eebec76c28a8ed9e8d8491f8c33e8fd85fb1 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Mon, 27 May 2013 20:40:16 -0400 Subject: Fixed cdata and text handling. wholeText on a text node holds the text of logically adjacent text. That means a new line followed by cdata following by spaces and/or a new line will all be in the cdata wholeText. This change fixes our handling to use data rather than wholeText. Also fixed the cdata regex tests. --- src/HTML5/Serializer/OutputRules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/HTML5') diff --git a/src/HTML5/Serializer/OutputRules.php b/src/HTML5/Serializer/OutputRules.php index 5780d61..3db857b 100644 --- a/src/HTML5/Serializer/OutputRules.php +++ b/src/HTML5/Serializer/OutputRules.php @@ -64,17 +64,17 @@ class OutputRules { */ public function text($ele) { if (isset($ele->parentNode) && Elements::isA($ele->parentNode->tagName, Elements::TEXT_RAW)) { - $this->wr($ele->wholeText); + $this->wr($ele->data); return; } // FIXME: This probably needs some flags set. - $this->wr($this->enc($ele->wholeText)); + $this->wr($this->enc($ele->data)); } public function cdata($ele) { - $this->wr('wr($ele->wholeText)->wr(']]>'); + $this->wr('wr($ele->data)->wr(']]>'); } public function comment($ele) { -- cgit v1.2.3