From 64eaa3365d74b58de23bb7787844ab3ead4b0b20 Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Thu, 11 Apr 2013 12:29:00 -0500 Subject: Working on tag parsing. --- test/HTML5/Parser/EventStack.php | 4 +++- test/HTML5/Parser/TokenizerTest.php | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'test/HTML5/Parser') diff --git a/test/HTML5/Parser/EventStack.php b/test/HTML5/Parser/EventStack.php index 68f0aa9..36e2f29 100644 --- a/test/HTML5/Parser/EventStack.php +++ b/test/HTML5/Parser/EventStack.php @@ -62,7 +62,9 @@ class EventStack implements EventHandler { } public function parseError($msg, $line, $col) { - throw new EventStackParseError(sprintf("%s (line %d, col %d)", $msg, $line, $col)); + //throw new EventStackParseError(sprintf("%s (line %d, col %d)", $msg, $line, $col)); + //$this->store(sprintf("%s (line %d, col %d)", $msg, $line, $col)); + $this->store('comment', func_get_args()); } diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php index b85a090..e006fb9 100644 --- a/test/HTML5/Parser/TokenizerTest.php +++ b/test/HTML5/Parser/TokenizerTest.php @@ -83,4 +83,12 @@ class TokenizerTest extends \HTML5\Tests\TestCase { $str = '&foo'; $events = $this->parse($str); } + + public function testBogusComment() { + $str = ''; + $events = $this->parse($str); + $e1 = $events->get(0); + $this->assertEquals('comment', $e1['name']); + $this->assertEquals($str, $e1['data'][0]); + } } -- cgit v1.2.3