From 5081159654f0b1d9d66cb7f540dbe9b5bd4ae3aa Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Fri, 28 Jun 2013 08:39:17 -0400 Subject: Added a test around prefixed xml. It's a weird and invalid case. But, following the naming conventions in 2.9 means parsing and spitting it out works though each element is treated as an unknown element. --- test/HTML5/Html5Test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/HTML5') diff --git a/test/HTML5/Html5Test.php b/test/HTML5/Html5Test.php index 14fcb2d..844d7fc 100644 --- a/test/HTML5/Html5Test.php +++ b/test/HTML5/Html5Test.php @@ -166,4 +166,21 @@ class Html5Test extends TestCase { $this->assertRegExp('|y|',$html); } + public function testUnknownElements() { + + // The : should not have special handling accourding to section 2.9 of the + // spec. This is differenant than XML. Since we don't know these elements + // they are handled as normal elements. Note, to do this is really + // an invalid example and you should not embed prefixed xml in html5. + $dom = \HTML5::loadHTMLFragment(" + Big rectangle thing + 40 + 80 + "); + + $this->assertEmpty($dom->errors); + $markup = \HTML5::saveHTML($dom); + $this->assertRegExp('|Big rectangle thing|',$markup); + } + } -- cgit v1.2.3