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. --- test/HTML5/Serializer/SerializerTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/HTML5/Serializer') diff --git a/test/HTML5/Serializer/SerializerTest.php b/test/HTML5/Serializer/SerializerTest.php index 4a28c54..234cca4 100644 --- a/test/HTML5/Serializer/SerializerTest.php +++ b/test/HTML5/Serializer/SerializerTest.php @@ -130,9 +130,8 @@ class SerializerTest extends \HTML5\Tests\TestCase { $this->assertRegExp('||', $res); } - // FAILS because the parser converts CDATA to a comment. Issue #2. public function testCDATA() { $res = $this->cycle($this->prepareHtml('a a test. ]]>b')); - $this->assertRegExp('| a test. ]]>|', $res); + $this->assertRegExp('| a test\. \]\]>|', $res); } } -- cgit v1.2.3