-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support the new angular "@-syntax"
Angular v17 introduces a new syntax that is not compatible anymore with pure HTML. This PR introduces a new component for the languages "angular" and its alias "ng".
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(function (Prism) { | ||
Prism.languages.angular = Prism.languages.extend('markup', { | ||
'keyword': /(?:@if|@for|@switch|@defer|@loading|@error|@placeholder|prefetch)\b/, | ||
'operator': /\b(?:on|when)\b/, | ||
'number': { | ||
pattern: /\b(minimum|after)\s+\d+(?:s|ms|)/gi, | ||
Check warning on line 6 in components/angular.js GitHub Actions / lint
Check warning on line 6 in components/angular.js GitHub Actions / lint
Check warning on line 6 in components/angular.js GitHub Actions / lint
|
||
lookbehind: true, | ||
}, | ||
'builtin': {pattern: /\b(?:viewport|timer|minimum|after|hover|idle|immediate|interaction)/}, | ||
'function': | ||
/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, | ||
}); | ||
|
||
Prism.languages.ng = Prism.languages.angular; | ||
})(Prism); |