Skip to content

Named characters references containing digits are not processed properly #51323

@myfonj

Description

@myfonj

Which @angular/* package(s) are the source of the bug?

compiler, core

Is this a regression?

No

Description

HTML standard defines many "named HTML entities", 24 of them include digits in their names, none of them is rendered correctly when present in Angular component's template, in contrast with other valid entities.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-test-html-entities-with-numbers?file=src%2Findex.html

Please provide the exception or error you saw

`»¹«` is output as `»¹«` instead of `»¹«` (or verbatim). See the screenshot further.

Please provide the environment you discovered this bug in (run ng version)

(Stackblitz Angular version in linked STR: 16.2.0)

Angular CLI: 13.2.6
Node: 16.20.2
Package Manager: npm 8.19.4
OS: win32 x64

Angular: 13.2.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1303.9
@angular-devkit/build-angular      13.3.9
@angular-devkit/core               13.3.9
@angular-devkit/schematics         13.2.6
@angular/cdk                       13.3.9
@angular/cli                       13.2.6
@angular/material                  13.3.9
@angular/material-moment-adapter   13.3.9
@schematics/angular                13.2.6
rxjs                               7.5.7
typescript                         4.5.5
webpack                            5.75.0

Anything else?

Screenshot; "»𝕏«" in the first content line is for check.

When static table is rendered, HTML entities work as expected, while same table in Angular component processes only entities without digits properly

List of all "entity names" (for search):

  • blk12
  • blk14
  • blk34
  • emsp13
  • emsp14
  • frac12
  • frac13
  • frac14
  • frac15
  • frac16
  • frac18
  • frac23
  • frac25
  • frac34
  • frac35
  • frac38
  • frac45
  • frac56
  • frac58
  • frac78
  • sup1
  • sup2
  • sup3
  • there4

(frac12, frac14, frac34, sup1, sup2, sup3 can be also without semicolon. None semicolon-less variant work in Angular component, even for non-digit entities.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerbugcompiler: parser

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions