Skip to content

Match tsc for JSX uppercase hex entities#4108

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-jsx-hex-entity-decoding
Draft

Match tsc for JSX uppercase hex entities#4108
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-jsx-hex-entity-decoding

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

tsgo decoded JSX numeric hex entities with an uppercase marker (&#X...;), while tsc leaves them literal. This caused JSX text and attribute emit to differ from TypeScript.

  • JSX entity decoding

    • Treat only lowercase x as the hexadecimal numeric entity marker.
    • Leave &#X...; unchanged by falling through as a non-entity.
  • Regression coverage

    • Added a compiler test covering uppercase hex markers in JSX text and attributes.
    • Kept coverage for lowercase hex and decimal entities to ensure they still decode.
export const a = <div title="&#X42;">&#X41;</div>;
// emits: React.createElement("div", { title: "&#X42;" }, "&#X41;")

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix JSX hex entity decoding issue in tsgo Match tsc for JSX uppercase hex entities May 30, 2026
Copilot AI requested a review from jakebailey May 30, 2026 17:11
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.

JSX hex entity with uppercase marker decoded by tsgo, left literal by tsc

2 participants