0
This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
highlight_js-rails/vendor/assets/javascripts/highlight_js/languages/haml.js
Rogaboru Kujimoshi a52831ccdb Update to 8.0
2014-06-08 21:04:39 +04:00

129 lines
3.0 KiB
JavaScript

/*
Language: Haml
Requires: ruby.js
Author: Dan Allen <dan.j.allen@gmail.com>
Website: http://google.com/profiles/dan.j.allen
*/
// 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
},
{
className: 'comment',
// FIXME these comments should be allowed to span indented lines
begin: '^\\s*(!=#|=#|-#|/).*$',
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+'
},
{
className: 'string',
begin: '"',
end: '"'
},
{
className: 'string',
begin: '\'',
end: '\''
},
{
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
},
{
className: 'string',
begin: '"',
end: '"'
},
{
className: 'string',
begin: '\'',
end: '\''
},
{
begin: '\\w+',
relevance: 0
}
]
}
]
}
]
},
{
className: 'bullet',
begin: '^\\s*[=~]\\s*',
relevance: 0
},
{
begin: '#{',
starts: {
end: '}',
subLanguage: 'ruby'
}
}
]
};
}