Masterminds / html5-php

An HTML5 parser and serializer for PHP.
http://masterminds.github.io/html5-php/
Other
1.55k stars 114 forks source link

Duplicate attributes are not handled the same than in the HTML specification. #242

Open stof opened 9 months ago

stof commented 9 months ago

Parsing a document containing <button type="submit" class="btn btn-outline-secondary rounded-right" type="button">Test</button> produces a DOM element with a type attribute set to button. However, the HTML specification explicitly says that duplicate attributes must be ignored: https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute This means that the first one should win, giving a type of submit.

See https://github.com/symfony/symfony/issues/52889 for the original report

goetas commented 1 month ago

is anyone willing to provide a fix for this issue?