src/PowerTools/HTML5/Parser/Tokenizer.php
protected function bogusComment($leading = '') {

        // TODO: This can be done more efficiently when the
        // scanner exposes a readUntil() method.
        $comment = $leading;
        $tok = $this->scanner->current();
        do {
            $comment .= $tok;
            $tok = $this->scanner->next();
        } while ($tok !== false && $tok != '>');

        $this->flushBuffer();
        $this->events->comment($comment . $tok);
        $this->scanner->next();

        return true;
    }
protected function bogusComment($leading = '') {

        // TODO: This can be done more efficiently when the
        // scanner exposes a readUntil() method.
        $comment = $leading;
        $tok = $this->scanner->current();
        do {
            $comment .= $tok;
            $tok = $this->scanner->next();
        } while ($tok !== false && $tok != '>');

        $this->flushBuffer();
        $this->events->comment($comment . $tok);
        $this->scanner->next();

        return true;
    }
protected function bogusComment ( $ leading = '' ) { // TODO: This can be done more efficiently when the // scanner exposes a readUntil() method. $ comment = $ leading ; $ tok = $ this -> scanner -> current ( ) ; do { $ comment .= $ tok ; $ tok = $ this -> scanner -> next ( ) ; } while ( $ tok !== false && $ tok != '>' ) ; $ this -> flushBuffer ( ) ; $ this -> events -> comment ( $ comment . $ tok ) ; $ this -> scanner -> next ( ) ; return true ; }
Consume malformed markup as if it were a comment.
8.2.4.44

The spec requires that the ENTIRE tag-like thing be enclosed inside of
the comment. So this will generate comments like:

&lt;!--&lt/+foo&gt;--&gt;

@param string $leading
Prepend any leading characters. This essentially
negates the need to backtrack, but it's sort of
a hack.
Consume malformed markup as if it were a comment . 8 . 2 . 4 . 44