diff options
author | Matt Butcher <[email protected]> | 2013-04-11 12:29:00 -0500 |
---|---|---|
committer | Matt Butcher <[email protected]> | 2013-04-11 12:29:00 -0500 |
commit | 64eaa3365d74b58de23bb7787844ab3ead4b0b20 (patch) | |
tree | 101c143f78645ae3281ae46ca99caa1c0fa54be1 /test/HTML5 | |
parent | 784fa7569a7f8e7c5742b2791e3d4356925deecc (diff) |
Working on tag parsing.
Diffstat (limited to 'test/HTML5')
-rw-r--r-- | test/HTML5/Parser/EventStack.php | 4 | ||||
-rw-r--r-- | test/HTML5/Parser/TokenizerTest.php | 8 |
2 files changed, 11 insertions, 1 deletions
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 = '</+this is a bogus comment. +>'; + $events = $this->parse($str); + $e1 = $events->get(0); + $this->assertEquals('comment', $e1['name']); + $this->assertEquals($str, $e1['data'][0]); + } } |