32 lines
906 B
JavaScript
32 lines
906 B
JavaScript
module.exports = function(hljs) {
|
|
var EXPRESSION_KEYWORDS = 'each in with if else unless bindattr action collection debugger log outlet template unbound view yield';
|
|
return {
|
|
aliases: ['hbs', 'html.hbs', 'html.handlebars'],
|
|
case_insensitive: true,
|
|
subLanguage: 'xml',
|
|
contains: [
|
|
{
|
|
className: 'expression',
|
|
begin: '{{', end: '}}',
|
|
contains: [
|
|
{
|
|
className: 'begin-block', begin: '\#[a-zA-Z\-\ \.]+',
|
|
keywords: EXPRESSION_KEYWORDS
|
|
},
|
|
{
|
|
className: 'string',
|
|
begin: '"', end: '"'
|
|
},
|
|
{
|
|
className: 'end-block', begin: '\\\/[a-zA-Z\-\ \.]+',
|
|
keywords: EXPRESSION_KEYWORDS
|
|
},
|
|
{
|
|
className: 'variable', begin: '[a-zA-Z\-\.]+',
|
|
keywords: EXPRESSION_KEYWORDS
|
|
}
|
|
]
|
|
}
|
|
]
|
|
};
|
|
}; |