mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
1d9e445d1a
The TextMate grammars for inline templates and inline styles ended the string at the first occurrence of the delimiter, so an escaped delimiter (e.g. \`) terminated the highlighting prematurely and the rest of the template was no longer highlighted as HTML. Escape sequences are now consumed before delegating to the HTML/CSS grammars, so escaped delimiters no longer end the string. Also removes the stray pipes from the string delimiter character class, which unintentionally matched a literal '|'. Fixes #65493
31 lines
838 B
TypeScript
31 lines
838 B
TypeScript
/* clang-format off */
|
|
|
|
@Component({
|
|
//// Property key/value test
|
|
styles: [ '.example { width: 100px; }' ],
|
|
|
|
//// Multiple styles test
|
|
styles: [
|
|
'.example { width: 100px; }',
|
|
'.example { height: 100px; }',
|
|
],
|
|
|
|
//// String delimiter tests
|
|
styles: [ `.example { width: 100px; }` ],
|
|
styles: [ ".example { width: 100px; }" ],
|
|
styles: [ '.example { width: 100px; }' ],
|
|
|
|
//// Parenthesization tests
|
|
styles: ( (( [ ( '.example { width: 100px; }' ) ] )) ),
|
|
//// styles string
|
|
styles: ( (( ( '.example { width: 100px; }' ) )) ),
|
|
styles: `.example { width: 100px; }` ,
|
|
styles: ".example { width: 100px; }" ,
|
|
styles: '.example { width: 100px; }' ,
|
|
|
|
//// Escaped delimiter tests
|
|
styles: [ `.example::before { content: '\`'; }` ],
|
|
styles: [ '.example::before { content: "\'"; }' ],
|
|
})
|
|
export class TMComponent{}
|