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

Breadcrumb

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

function Tokenizer::quotedAttributeValue

Get an attribute value string.

Parameters

string $quote IMPORTANT: This is a series of chars! Any one of which will be considered: termination of an attribute's value. E.g. "\"'" will stop at either ' or ".

Return value

string The attribute value.

1 call to Tokenizer::quotedAttributeValue()
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 568

Class

Tokenizer
The HTML5 tokenizer.

Namespace

Masterminds\HTML5\Parser

Code

protected function quotedAttributeValue($quote) {
    $stoplist = "\f" . $quote;
    $val = '';
    while (true) {
        $tokens = $this->scanner
            ->charsUntil($stoplist . '&');
        if (false !== $tokens) {
            $val .= $tokens;
        }
        else {
            break;
        }
        $tok = $this->scanner
            ->current();
        if ('&' == $tok) {
            $val .= $this->decodeCharacterReference(true);
            continue;
        }
        break;
    }
    $this->scanner
        ->consume();
    return $val;
}
RSS feed
Powered by Drupal