Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Tokenizer.php

function Tokenizer::unquotedAttributeValue

1 call to Tokenizer::unquotedAttributeValue()
Tokenizer::attributeValue in vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php
Consume an attribute value. See section 8.2.4.37 and after.

File

vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php, line 593

Class

Tokenizer
The HTML5 tokenizer.

Namespace

Masterminds\HTML5\Parser

Code

protected function unquotedAttributeValue() {
    $val = '';
    $tok = $this->scanner
        ->current();
    while (false !== $tok) {
        switch ($tok) {
            case "\n":
            case "\f":
            case ' ':
            case "\t":
            case '>':
                break 2;
            case '&':
                $val .= $this->decodeCharacterReference(true);
                $tok = $this->scanner
                    ->current();
                break;
            case "'":
            case '"':
            case '<':
            case '=':
            case '`':
                $this->parseError('Unexpected chars in unquoted attribute value %s', $tok);
                $val .= $tok;
                $tok = $this->scanner
                    ->next();
                break;
            default:
                $val .= $this->scanner
                    ->charsUntil("\t\n\f >&\"'<=`");
                $tok = $this->scanner
                    ->current();
        }
    }
    return $val;
}
RSS feed
Powered by Drupal