Skip to content

some HTML entities in JSX emits incorrect unicode literal #35732

@gaeulbyul

Description

@gaeulbyul

TypeScript Version: Nightly

Search Terms: JSX entities, HTML entities

Expected behavior:

// (copied from Babel REPL)
React.createElement("div", null, "\uD83D\uDC08\uD83D\uDC15\uD83D\uDC07\uD83D\uDC11");

Actual behavior:

React.createElement("div", null, "\uF408\uF415\uF407\uF411");

Related Issues:

Code

<div>&#x1F408;&#x1F415;&#128007;&#128017;</div>;
Output
"use strict";
React.createElement("div", null, "\uF408\uF415\uF407\uF411");
Compiler Options
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "useDefineForClassFields": false,
    "alwaysStrict": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "downlevelIteration": false,
    "noEmitHelpers": false,
    "noLib": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "esModuleInterop": true,
    "preserveConstEnums": false,
    "removeComments": false,
    "skipLibCheck": false,
    "checkJs": false,
    "allowJs": false,
    "declaration": true,
    "experimentalDecorators": false,
    "emitDecoratorMetadata": false,
    "target": "ES2017",
    "module": "ESNext"
  }
}

Playground Link: Provided


Some HTML entities (e.g. Emoji) in JSX emit incorrect literals and doesn't show emoji properly.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions