private function contextHtmlText() { $matches = $this->match('~ (?:(?<=\\n|^)[ \\t]*)?<(?P<closing>/?)(?P<tag>[a-z][a-z0-9:]*)| ## begin of HTML tag <tag </tag - ignores <!DOCTYPE <(?P<htmlcomment>!(?:--(?!>))?|\\?(?!=|php))| ## begin of <!, <!--, <!DOCTYPE, <?, but not <?php and <?= (?P<macro>' . $this->delimiters[0] . ') ~xsi'); if (!empty($matches['htmlcomment'])) { // <! <? $this->addToken(Token::HTML_TAG_BEGIN, $matches[0]); $end = $matches['htmlcomment'] === '!--' ? '--' : ($matches['htmlcomment'] === '?' && $this->xmlMode ? '\\?' : ''); $this->setContext(self::CONTEXT_HTML_COMMENT, $end); } elseif (!empty($matches['tag'])) { // <tag or </tag $token = $this->addToken(Token::HTML_TAG_BEGIN, $matches[0]); $token->name = $matches['tag']; $token->closing = (bool) $matches['closing']; $this->lastHtmlTag = $matches['closing'] . strtolower($matches['tag']); $this->setContext(self::CONTEXT_HTML_TAG); } else { return $this->processMacro($matches); } }