summaryrefslogtreecommitdiff
path: root/src/HTML5/Parser
diff options
context:
space:
mode:
authorZhaofeng Li <[email protected]>2015-02-02 10:21:03 +0800
committerZhaofeng Li <[email protected]>2015-02-02 10:47:35 +0800
commit7c1c7dfab1b258d0b93975e7abf20de191974ad7 (patch)
tree41e79117a91d4a64c926b2adf6137f1739f99638 /src/HTML5/Parser
parent700717e32d20813053f37244ee0b5bb0d0b0180e (diff)
Allow whitespaces in RCDATA end tags
Fixes #75 Signed-off-by: Zhaofeng Li <[email protected]>
Diffstat (limited to 'src/HTML5/Parser')
-rw-r--r--src/HTML5/Parser/Tokenizer.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php
index 958ade8..e00b9a2 100644
--- a/src/HTML5/Parser/Tokenizer.php
+++ b/src/HTML5/Parser/Tokenizer.php
@@ -200,7 +200,7 @@ class Tokenizer
if (is_null($this->untilTag)) {
return $this->text();
}
- $sequence = '</' . $this->untilTag . '>';
+ $sequence = '</' . $this->untilTag;
$txt = '';
$tok = $this->scanner->current();
@@ -214,6 +214,13 @@ class Tokenizer
$tok = $this->scanner->next();
}
}
+ $len = strlen($sequence);
+ $this->scanner->consume($len);
+ $len += strlen($this->scanner->whitespace());
+ if ($this->scanner->current() !== '>') {
+ $this->parseError("Unclosed RCDATA end tag");
+ }
+ $this->scanner->unconsume($len);
$this->events->text($txt);
$this->setTextMode(0);
return $this->endTag();