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\ParserCode
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;
}