We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab71073 + 1660321 commit b2375acCopy full SHA for b2375ac
src/HTML5/Parser/Tokenizer.php
@@ -507,7 +507,7 @@ protected function attribute(&$attributes)
507
$this->scanner->whitespace();
508
509
$val = $this->attributeValue();
510
- if ($isValidAttribute) {
+ if ($isValidAttribute && !array_key_exists($name, $attributes)) {
511
$attributes[$name] = $val;
512
}
513
test/HTML5/Parser/TokenizerTest.php
@@ -705,6 +705,14 @@ public function testTagAttributes()
705
),
706
false,
707
708
+ // duplicate attributes must be ignored
709
+ '<foo bar="first" bar="second">' => array(
710
+ 'foo',
711
+ array(
712
+ 'bar' => 'first',
713
+ ),
714
+ false,
715
716
);
717
$this->isAllGood('startTag', 2, $good);
718
0 commit comments