Skip to content

fix: define shared html escaping helper#554

Open
saurabhhhcodes wants to merge 1 commit into
Shruti070107:mainfrom
saurabhhhcodes:fix/escape-html-helper-551
Open

fix: define shared html escaping helper#554
saurabhhhcodes wants to merge 1 commit into
Shruti070107:mainfrom
saurabhhhcodes:fix/escape-html-helper-551

Conversation

@saurabhhhcodes

Copy link
Copy Markdown

Summary

  • add a shared escapeHTML utility for the existing interpolated HTML rendering paths
  • import it into src/app.js so the current callsites no longer throw ReferenceError
  • add a regression validator that checks escaping for HTML/script-sensitive characters and nullish values

Validation

  • node --check src/html-utils.js
  • node --check src/app.js
  • node --check scripts/validate-escape-html.mjs
  • npm test
  • npm run build
  • git diff --check

Fixes #551

@saurabhhhcodes

Copy link
Copy Markdown
Author

Validation completed locally:

  • node --check src/html-utils.js
  • node --check src/app.js
  • node --check scripts/validate-escape-html.mjs
  • npm test
  • npm run build
  • git diff --check

The PR is merge-clean from GitHub and scoped to #551. Could maintainers please add the relevant GSSoC scoring labels if this fix is accepted, since the issue currently has no labels on GitHub?

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.

Bug : escapeHTML() is called ~30+ times but is never defined, causing ReferenceError crashes across the app

1 participant