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

107 lines
2.5 KiB
JavaScript

module.exports = // TODO support filter tags like :javascript, support inline HTML
function(hljs) {
return {
case_insensitive: true,
contains: [
{
className: 'doctype',
begin: '^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$',
relevance: 10
},
// FIXME these comments should be allowed to span indented lines
hljs.COMMENT(
'^\\s*(!=#|=#|-#|/).*$',
false,
{
relevance: 0
}
),
{
begin: '^\\s*(-|=|!=)(?!#)',
starts: {
end: '\\n',
subLanguage: 'ruby'
}
},
{
className: 'tag',
begin: '^\\s*%',
contains: [
{
className: 'title',
begin: '\\w+'
},
{
className: 'value',
begin: '[#\\.][\\w-]+'
},
{
begin: '{\\s*',
end: '\\s*}',
excludeEnd: true,
contains: [
{
//className: 'attribute',
begin: ':\\w+\\s*=>',
end: ',\\s+',
returnBegin: true,
endsWithParent: true,
contains: [
{
className: 'symbol',
begin: ':\\w+'
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
begin: '\\w+',
relevance: 0
}
]
}
]
},
{
begin: '\\(\\s*',
end: '\\s*\\)',
excludeEnd: true,
contains: [
{
//className: 'attribute',
begin: '\\w+\\s*=',
end: '\\s+',
returnBegin: true,
endsWithParent: true,
contains: [
{
className: 'attribute',
begin: '\\w+',
relevance: 0
},
hljs.APOS_STRING_MODE,
hljs.QUOTE_STRING_MODE,
{
begin: '\\w+',
relevance: 0
}
]
}
]
}
]
},
{
className: 'bullet',
begin: '^\\s*[=~]\\s*',
relevance: 0
},
{
begin: '#{',
starts: {
end: '}',
subLanguage: 'ruby'
}
}
]
};
};