Skip to content

v1.7.x with typescript 2.6.x css escape regression #9567

Closed
@kondi

Description

@kondi

Versions

Angular CLI: 1.7.0-rc.0
Node: 7.4.0
OS: win32 x64
Angular: 5.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.0-rc.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0-rc.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.6.1
webpack: 3.10.0

Repro steps

h1::before {
    content: 'A: \0041';
}
  • ng serve --prod => "A: A Welcome to app!" (works well)
  • Upgrade typescript to 2.6.1 (kondi/clicssbug@036e448)
  • ng serve --prod => "A: x00041 Welcome to app!" (buggy build)

Observed behavior

The prod build changes the escaping in the string literal of CSS rule to invalid \x00041:

h1[_ngcontent-c0]::before {
    content: 'A: \x00041';
}

Desired behavior

It should not change the represented value of the string literal.

Mention any other details that might be useful (optional)

  • Not prod build => OK
  • If cli downgraded to 1.6.x => OK
  • If typescript downgraded to 2.5.x => OK
  • If scss is used => Not OK
  • Same rule inside the global styles.css => OK

The syntax I used in the CSS literal is quite common if you use font icons.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions