summaryrefslogtreecommitdiff
path: root/test/HTML5/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'test/HTML5/Parser')
-rw-r--r--test/HTML5/Parser/EventStack.php4
-rw-r--r--test/HTML5/Parser/TokenizerTest.php8
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]);
+ }
}