Skip to content

feat: preserve html entities in proxy console#577

Draft
AdityaSingh-18 wants to merge 1 commit intofreeCodeCamp:mainfrom
AdityaSingh-18:feat/preserve-html-entities-proxy-console
Draft

feat: preserve html entities in proxy console#577
AdityaSingh-18 wants to merge 1 commit intofreeCodeCamp:mainfrom
AdityaSingh-18:feat/preserve-html-entities-proxy-console

Conversation

@AdityaSingh-18
Copy link

@AdityaSingh-18 AdityaSingh-18 commented Mar 16, 2026

Checklist:

Closes #63788

Double-encode HTML entities in proxy-console before the string reaches sanitizeHtml. For example & becomes & and sanitizeHtml then decodes it back to & which the browser renders as the literal text &.

Babel/system errors go through window.onerror and bypass proxy-console entirely, so they are unaffected by this change.

To verify the fix locally, the built output was manually patched in the freeCodeCamp dev environment using a Python script that replaced the relevant line in the bundled javascript-test-evaluator.js files:

client/static/js/test-runner/8.0.0/javascript-test-evaluator.js
client/public/js/test-runner/8.0.0/javascript-test-evaluator.js
tools/client-plugins/browser-scripts/dist/js/test-runner/8.0.0/javascript-test-evaluator.js

The patch replaced:

const n=t.map((e=>this.#o(e))).join(" ");this.#r.push({level:e,msg:n})

With:

const n=t.map((e=>this.#o(e))).join(" ").replace(/&(amp|lt|gt|quot|apos)(;?)/g,"&$1$2");this.#r.push({level:e,msg:n})
Images

brave_screenshot_silver-palm-tree-pjvvwj4r9vxvh7w9p-8000 app github dev (1) brave_screenshot_silver-palm-tree-pjvvwj4r9vxvh7w9p-8000 app github dev brave_screenshot_expert-system-jj667jv5gr4gfjqpx-8000 app github dev (2)

@AdityaSingh-18 AdityaSingh-18 requested a review from a team as a code owner March 16, 2026 10:03
@AdityaSingh-18 AdityaSingh-18 marked this pull request as draft March 16, 2026 10:49
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.

Escaping HTML entities

1 participant