-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
Copy pathdust.js
45 lines (44 loc) · 1005 Bytes
/
dust.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Language: Dust
Requires: xml.js
Author: Michael Allen <[email protected]>
Description: Matcher for dust.js templates.
Website: https://www.dustjs.com
Category: template
*/
/** @type LanguageFn */
export default function(hljs) {
const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';
return {
name: 'Dust',
aliases: [ 'dst' ],
case_insensitive: true,
subLanguage: 'xml',
contains: [
{
className: 'template-tag',
begin: /\{[#\/]/,
end: /\}/,
illegal: /;/,
contains: [
{
className: 'name',
begin: /[a-zA-Z\.-]+/,
starts: {
endsWithParent: true,
relevance: 0,
contains: [ hljs.QUOTE_STRING_MODE ]
}
}
]
},
{
className: 'template-variable',
begin: /\{/,
end: /\}/,
illegal: /;/,
keywords: EXPRESSION_KEYWORDS
}
]
};
}