Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use textContent to avoid HTML special characters in options #5782

Merged
merged 3 commits into from
Sep 30, 2022

Conversation

ggorlen
Copy link
Contributor

@ggorlen ggorlen commented Sep 1, 2022

Resolves #5778

Changes:

  • Use textContent rather than innerHTML to set and compare options in a select menu, avoiding parsing HTML and escaping HTML special characters that might happen to be in the string (see linked issue for details).
  • Add unit test with HTML special characters that fails on the old innerHTML and passes on textContent.

PR Checklist

@limzykenneth limzykenneth merged commit 592e7af into processing:main Sep 30, 2022
@limzykenneth
Copy link
Member

Looks good. Thanks!

@all-contributors please add @ggorlen for code

@allcontributors
Copy link
Contributor

@limzykenneth

I've put up a pull request to add @ggorlen! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOM module: HTML special characters break select options
2 participants