Tokenizer::quotedAttributeValue() has special handling for form feed characters.
(This used to also include newlines and tabs but was removed in 8785fc5.)
Because of this, if an attribute contains a form feed, everything after this character is ignored.
This creates a discrepancy between masterminds/html5 and the native DOM extension:
$html = "<img src='foo.png' alt='before \f after'>";
$html5 = new HTML5();
$dom = $html5->loadHTML($html);
echo $html5->saveHTML($dom);
// <img src="foo.png" alt="before ">
$dom = new DOMDocument();
$dom->loadHTML($html);
echo $dom->saveHTML();
// <img src="foo.png" alt="before after">
This HTML containing a form feed character in the alt attribute is valid according to https://validator.w3.org/:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<img src="foo.png" alt=" foo">
</body>
</html>
Tokenizer::quotedAttributeValue() has special handling for form feed characters.
(This used to also include newlines and tabs but was removed in 8785fc5.)
Because of this, if an attribute contains a form feed, everything after this character is ignored.
This creates a discrepancy between masterminds/html5 and the native DOM extension:
This HTML containing a form feed character in the alt attribute is valid according to https://validator.w3.org/: