p5.js
p5.js copied to clipboard
Use textContent to avoid HTML special characters in options
trafficstars
Resolves https://github.com/processing/p5.js/issues/5778
Changes:
- Use
textContentrather thaninnerHTMLto 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
innerHTMLand passes ontextContent.
PR Checklist
- [x]
npm run lintpasses - [x] Inline documentation is included / updated
- [x] Unit tests are included / updated