p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Use textContent to avoid HTML special characters in options

Open ggorlen opened this issue 3 years ago • 0 comments
trafficstars

Resolves https://github.com/processing/p5.js/issues/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

ggorlen avatar Sep 01 '22 18:09 ggorlen