diff options
Diffstat (limited to 'src/HTML5')
-rw-r--r-- | src/HTML5/Parser/Scanner.php | 18 | ||||
-rw-r--r-- | src/HTML5/Parser/Tokenizer.php | 17 |
2 files changed, 9 insertions, 26 deletions
diff --git a/src/HTML5/Parser/Scanner.php b/src/HTML5/Parser/Scanner.php index 7277dc9..1ab9b8b 100644 --- a/src/HTML5/Parser/Scanner.php +++ b/src/HTML5/Parser/Scanner.php @@ -64,15 +64,6 @@ class Scanner { } /** - * Silently consume N chars. - */ - public function consume($count = 1) { - for ($i = 0; $i < $count; ++$i) { - $this->next(); - } - } - - /** * Get the current character. * * Note, this does not advance the pointer. @@ -88,6 +79,15 @@ class Scanner { } /** + * Silently consume N chars. + */ + public function consume($count = 1) { + for ($i = 0; $i < $count; ++$i) { + $this->next(); + } + } + + /** * Unconsume some of the data. This moves the data pointer backwards. * * @param int $howMany diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php index a64a832..f3e45e1 100644 --- a/src/HTML5/Parser/Tokenizer.php +++ b/src/HTML5/Parser/Tokenizer.php @@ -766,7 +766,6 @@ class Tokenizer { $tok = $this->scanner->next(); } while (!$this->sequenceMatches(']]>')); - //while (!$this->isCdataClose()); // Consume ]]> $this->scanner->consume(3); @@ -775,22 +774,6 @@ class Tokenizer { return TRUE; } - /** - * Check whether the parser has reached the end of a CDATA section. - */ - protected function isCdataClose() { - $tok = $this->scanner->current(); - if ($tok != ']') { - return FALSE; - } - $tok = $this->scanner->next(); - if ($tok == ']' && $this->scanner->peek() == '>') { - return TRUE; - } - // Unconsume one char and return. - $this->scanner->unconsume(); - return FALSE; - } // ================================================================ // Non-HTML5 |