src/PowerTools/HTML5/Parser/Tokenizer.php
protected function cdataSection() {
        if ($this->scanner->current() != '[') {
            return false;
        }
        $cdata = '';
        $this->scanner->next();

        $chars = $this->scanner->charsWhile('CDAT');
        if ($chars != 'CDATA' || $this->scanner->current() != '[') {
            $this->parseError('Expected [CDATA[, got %s', $chars);
            return $this->bogusComment('<![' . $chars);
        }

        $tok = $this->scanner->next();
        do {
            if ($tok === false) {
                $this->parseError('Unexpected EOF inside CDATA.');
                $this->bogusComment('<![CDATA[' . $cdata);
                return true;
            }
            $cdata .= $tok;
            $tok = $this->scanner->next();
        } while (!$this->sequenceMatches(']]>'));

        // Consume ]]>
        $this->scanner->consume(3);

        $this->events->cdata($cdata);
        return true;
    }
protected function cdataSection() {
        if ($this->scanner->current() != '[') {
            return false;
        }
        $cdata = '';
        $this->scanner->next();

        $chars = $this->scanner->charsWhile('CDAT');
        if ($chars != 'CDATA' || $this->scanner->current() != '[') {
            $this->parseError('Expected [CDATA[, got %s', $chars);
            return $this->bogusComment('<![' . $chars);
        }

        $tok = $this->scanner->next();
        do {
            if ($tok === false) {
                $this->parseError('Unexpected EOF inside CDATA.');
                $this->bogusComment('<![CDATA[' . $cdata);
                return true;
            }
            $cdata .= $tok;
            $tok = $this->scanner->next();
        } while (!$this->sequenceMatches(']]>'));

        // Consume ]]>
        $this->scanner->consume(3);

        $this->events->cdata($cdata);
        return true;
    }
protected function cdataSection ( ) { if ( $ this -> scanner -> current ( ) != '[' ) { return false ; } $ cdata = '' ; $ this -> scanner -> next ( ) ; $ chars = $ this -> scanner -> charsWhile ( 'CDAT' ) ; if ( $ chars != 'CDATA' || $ this -> scanner -> current ( ) != '[' ) { $ this -> parseError ( 'Expected [CDATA[, got %s' , $ chars ) ; return $ this -> bogusComment ( '<![' . $ chars ) ; } $ tok = $ this -> scanner -> next ( ) ; do { if ( $ tok === false ) { $ this -> parseError ( 'Unexpected EOF inside CDATA.' ) ; $ this -> bogusComment ( '<![CDATA[' . $ cdata ) ; return true ; } $ cdata .= $ tok ; $ tok = $ this -> scanner -> next ( ) ; } while ( ! $ this -> sequenceMatches ( ']]>' ) ) ; // Consume ]]> $ this -> scanner -> consume ( 3 ) ; $ this -> events -> cdata ( $ cdata ) ; return true ; }
Handle a CDATA section.
Handle a CDATA section .