taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

First attribute in a tag wins #234

Closed bennbollay closed 1 year ago

bennbollay commented 1 year ago

The HTML specification nominally does not allow duplicate attributes in a tag (see 13.1.2.3, last paragraph). However, browsers fail graciously when encountering such a tag, respecting only the first tag present and discarding subsequent duplicates (Safari 17614.1.25.9.10, Chrome 109.0.5414.119).

Bring node-html-parser in alignment with that convention, respecting the first attribute and ignoring subsequent matches.

bennbollay commented 1 year ago

Any further action I need to take for this to be merged in?