Skip to content

PM-6601: Fix angle brackets in Marathon Match article - #7286

Merged
jmgasper merged 1 commit into
developfrom
PM-6601
Oct 19, 2026
Merged

jmgasper merged 1 commit into
developfrom
PM-6601

Conversation

@jmgasper

@jmgasper jmgasper commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

What was broken

The Marathon Match Local Tester Parameters article displayed &lt; and &gt; instead of angle brackets in its compilation commands. For example, readers saw javac &lt;TesterClassName&gt;.java instead of javac <TesterClassName>.java.

Root cause

The public article is currently served by Community App, as confirmed by its response HTML and script assets. Its Markdown renderer passed decoded text through the HTML sanitizer before React escaped it again, generating &amp;lt; and &amp;gt; in the output HTML.

What was changed

Pass parsed text tokens directly to React so they are escaped exactly once, and document why this is safe for text content. The fix is confined to the text-token path; it does not decode entity strings recursively or insert raw HTML.

Files modified:

  • src/shared/utils/markdown.js
  • __tests__/shared/utils/markdown.js

Any added/updated tests

Added three regression tests covering the article's javac/jar commands in rendered DOM and serialized HTML, literal entity names, and escaped script/image examples remaining inactive text. The command regression reproduced the screenshot before the fix. Existing snapshots did not change.

Validation used nvm use (Node v10.24.1):

  • npm test passed, including JavaScript/SCSS lint and the retired-CMS network-target check: 168 passing suites, 456 passing tests, and 141 passing snapshots. The suite retains its 4 skipped suites and 23 skipped tests.
  • npm run build passed.
  • git diff --check passed.

What was broken
The Marathon Match Local Tester Parameters article displayed literal &lt;
and &gt; entity names in its javac and jar command examples.

Root cause
Community App still serves the public article. Its Markdown renderer passed
decoded text tokens through the HTML sanitizer before React escaped them
again, producing double-escaped angle brackets.

What was changed
Pass parsed text tokens directly to React so they are escaped exactly once.
Update the renderer documentation to explain text handling. Keep the fix
limited to Community App's text-token path and its regression tests.

Any added/updated tests
Add DOM and serialized-HTML regressions for the article's two commands,
literal entity names, and escaped script/image examples remaining text.
Verified the command regression fails before the fix.

Validation: npm test passed, including JavaScript/SCSS lint, the retired-CMS
target check, 456 tests, and 141 snapshots (23 existing test skips).
npm run build and git diff --check passed using Node v10.24.1 via nvm use.
@jmgasper
jmgasper requested a review from kkartunov as a code owner October 15, 2026 19:53
@jmgasper
jmgasper merged commit 249020e into develop Oct 19, 2026
7 checks passed
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.

1 participant