Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
269 lines (260 sloc) 9.14 KB
{
"name": "Handlebars",
"uuid": "1d7c0a8c-2361-4f78-b98e-1eaf2a288d3f",
"scopeName": "text.html.handlebars",
"fileTypes": ["handlebars", "hbs"],
"foldingStartMarker": "(?x)(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\\b.*?>|<!--(?!.*-->)|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))|\\{\\{\\#)",
"foldingStopMarker": "(?x)(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>|^\\s*-->|(^|\\s)\\}|\\{\\{/)",
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" },
{ "include": "#html_tags" }
],
"repository": {
"comments" : {
"patterns": [
{ "name" : "comment.block.handlebars",
"begin" : "\\{\\{!",
"end" : "\\}\\}",
"patterns" : [
{
"name" : "keyword.annotation.handlebars",
"match" : "@\\w*"
},
{ "include": "#comments" }
]
}
]
},
"partial_and_var": {
"name": "meta.function.inline.other.handlebars",
"begin": "(\\{\\{\\{*>*)\\s*([-a-zA-Z_\\./]+)*",
"end": "(\\}\\}\\}*)",
"beginCaptures": {
"1": { "name": "support.constant.handlebars" },
"2": { "name": "variable.parameter.handlebars" }
},
"endCaptures": {
"1": { "name": "support.constant.handlebars" }
},
"patterns": [
{ "include": "#string_single_quoted" },
{ "include": "#string_double_quoted" }
]
},
"block_helper": {
"name": "meta.function.block.start.handlebars",
"begin": "(\\{\\{\\#)([-a-zA-Z_\\./]+)\\s+([-a-zA-Z_\\./]+)*",
"end": "(\\}\\})",
"beginCaptures": {
"1": { "name": "support.constant.handlebars" },
"2": { "name": "support.constant.handlebars" },
"3": { "name": "variable.parameter.handlebars" }
},
"endCaptures": {
"1": { "name": "support.constant.handlebars" }
},
"patterns": [
{ "include": "#string_single_quoted" },
{ "include": "#string_double_quoted" }
]
},
"end_block": {
"name": "meta.function.block.end.handlebars.sproutcore",
"begin": "(\\{\\{/)([a-zA-Z_\\.-]+)\\s*",
"end": "(\\}\\})",
"beginCaptures": {
"1": { "name": "support.constant.handlebars" },
"2": { "name": "support.constant.handlebars" }
},
"endCaptures": {
"1": { "name": "support.constant.handlebars" }
},
"patterns": [
]
},
"string_double_quoted": {
"name": "string.quoted.double.html",
"begin": "\"",
"end": "\"",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
},
"string_single_quoted": {
"name": "string.quoted.single.html",
"begin": "'",
"end": "'",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
},
"tag_generic_attribute": {
"name": "entity.other.attribute-name.html",
"match": "\\b([a-zA-Z\\-:]+)",
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
},
"tag-id-attribute": {
"name": "meta.attribute-with-value.id.html",
"begin": "\\b(id)\\b\\s*(=)",
"end": "(?<=''|\")",
"captures": {
"1": { "name": "entity.other.attribute-name.id.html" },
"2": { "name": "punctuation.separator.key-value.html" }
},
"patterns": [
{ "name": "string.quoted.double.html",
"contentName": "meta.toc-list.id.html",
"begin": "\"",
"end": "\"",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#partial_and_var" }
]
},
{ "name": "string.quoted.single.html",
"contentName": "meta.toc-list.id.html",
"begin": "'",
"end": "'",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
}
]
},
"html_tags": {
"patterns": [
{ "name": "meta.tag.any.html",
"begin": "(<)([a-zA-Z0-9:]++)(?=[^>]*></\\2>)",
"end": "(>)(<)(/)(\\2)(>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.html" }
},
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.html" },
"2": { "name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" },
"3": { "name": "punctuation.definition.tag.begin.html" },
"4": { "name": "entity.name.tag.html" },
"5": { "name": "punctuation.definition.tag.end.html" }
},
"patterns": [
{ "include": "#tag_stuff" }
]
},
{ "name": "meta.tag.structure.any.html",
"begin": "(</?)((?i:body|head|html)\\b)",
"end": "(>)",
"captures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.structure.any.html" }
},
"endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } },
"patterns": [ { "include": "#tag_stuff" } ]
},
{ "name": "meta.tag.block.any.html",
"begin": "(</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
"end": "(>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.block.any.html" }
},
"endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } },
"patterns": [ { "include": "#tag_stuff" } ]
},
{ "name": "meta.tag.inline.any.html",
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"end": "((?: ?/)?>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.inline.any.html" }
},
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.html" }
},
"patterns": [ { "include": "#tag_stuff" } ]
},
{ "name": "meta.tag.other.html",
"begin": "(</?)([a-zA-Z0-9:]+)",
"end": "(>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.other.html" }
},
"endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } },
"patterns": [
{ "include": "#tag_stuff" }
]
},
{ "include": "#entities" },
{ "name": "invalid.illegal.incomplete.html",
"match": "<>"
},
{ "name": "invalid.illegal.bad-angle-bracket.html",
"match": "<"
}
]
},
"entities": {
"patterns": [
{ "name": "constant.character.entity.html",
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"captures": {
"1": { "name": "punctuation.definition.entity.html" },
"3": { "name": "punctuation.definition.entity.html" }
}
},
{ "name": "invalid.illegal.bad-ampersand.html",
"match": "&"
}
]
},
"tag_stuff": {
"patterns": [
{ "include": "#tag_id_attribute" },
{ "include": "#tag_generic_attribute" },
{ "include": "#string_double_quoted" },
{ "include": "#string_single_quoted" }
]
}
}
}