biofriction-wp-theme/node_modules/highlight.js/lib/languages/handlebars.js

32 lines
906 B
JavaScript
Raw Normal View History

2021-10-26 14:18:09 +02:00
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
}
]
}
]
};
};