Skip to content

Conversation

@hamishwillee
Copy link
Collaborator

This follows #41695 with even more tweaks to the setHTML methods. Specifically it makes clear that data-attributes are not removed by in all cases (though they are by the default sanitizer). It adds embed to the list of elements that can be removed.

In addition, this tidies the examples a bit, which were broken by a recently added script end tag.

@hamishwillee hamishwillee requested a review from a team as a code owner October 27, 2025 23:53
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Oct 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2025

@wbamberg
Copy link
Collaborator

broken by a recently added script end tag.

That's ironic.

Copy link
Member

@sideshowbarker sideshowbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t feel strongly about data- attribute vs data-attribute, so feel free to not commit the suggestions. But to me at least, “data-attribute” seemed odd (I don’t recall having seen it in existing content) — at least, ambiguous and potentially confusing to readers. So data- attribute seems less ambiguous and less potentially confusing.

hamishwillee and others added 2 commits October 28, 2025 18:15
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
@hamishwillee
Copy link
Collaborator Author

Thanks @sideshowbarker . I think you're right. Accepted your changes, though in a couple of places made minor changes so that it wouldn't break the code.

@hamishwillee hamishwillee merged commit 1ad7426 into mdn:main Oct 28, 2025
8 checks passed
@hamishwillee hamishwillee deleted the setHTML_tidy branch November 2, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants