pQuery\HtmlParserBase::parse_doctype PHP Метод

parse_doctype() публичный Метод

Parse doctype tag
public parse_doctype ( ) : boolean
Результат boolean
    function parse_doctype()
    {
        $start = $this->pos;
        if ($this->next_search('[>', false) === self::TOK_UNKNOWN) {
            if ($this->doc[$this->pos] === '[') {
                if ($this->next_pos(']', false) !== self::TOK_UNKNOWN || $this->next_pos('>', false) !== self::TOK_UNKNOWN) {
                    $this->addError('Invalid doctype');
                    return false;
                }
            }
            $this->token_start = $start;
            $this->status['dtd'] = $this->getTokenString(2, -1);
            $this->status['last_pos'] = $this->pos;
            return true;
        } else {
            $this->addError('Invalid doctype');
            return false;
        }
    }