Commit 9cd2788
committed
fix(attributes): make removeAttr case-insensitive for HTML documents
htmlparser2 stores HTML attribute names in lowercase per the HTML spec.
removeAttribute was doing a case-sensitive Object.hasOwn check and delete,
which caused removeAttr('CLASS') to fail when the attribute was stored
as 'class'. Normalize the attribute name to lowercase before checking
and deleting to match htmlparser2's storage convention.
Fixes #52571 parent 5aa508d commit 9cd2788
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
842 | 845 | | |
843 | | - | |
| 846 | + | |
844 | 847 | | |
845 | 848 | | |
846 | 849 | | |
| |||
0 commit comments