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
47 lines
977 B
TypeScript
47 lines
977 B
TypeScript
/* clang-format off */
|
|
|
|
/* Inline template recognition tests */
|
|
@Component({
|
|
//// Property key/value test
|
|
template: '<div></div>',
|
|
|
|
//// String delimiter tests
|
|
template: `<div></div>`,
|
|
template: "<div></div>",
|
|
template: '<div></div>',
|
|
|
|
//// Parenthesization tests
|
|
template: ( (( '<div></div>' )) ),
|
|
|
|
//// Comments tests
|
|
// template: '<div></div>'
|
|
/*
|
|
* template: '<div></div>'
|
|
*/
|
|
/**
|
|
* template: '<div></div>'
|
|
*/
|
|
})
|
|
export class TMComponent{}
|
|
|
|
/* Template syntax tests */
|
|
@Component({
|
|
// Interpolation test
|
|
template: '{{property}}',
|
|
})
|
|
export class TMComponent{}
|
|
|
|
/* Escaped delimiter tests */
|
|
@Component({
|
|
//// Escaped backtick test
|
|
template: `<button title="\`code\`">Hello</button>`,
|
|
|
|
//// Escaped quote tests
|
|
template: '<div title="it\'s">Hello</div>',
|
|
template: "<div title=\"quoted\">Hello</div>",
|
|
|
|
//// Escaped backslash before the closing delimiter
|
|
template: `<div>backslash \\</div>`,
|
|
})
|
|
export class TMComponent{}
|