{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "HRML HTML Injection",
"scopeName": "text.html.hrml.injection",
"injectionSelector": "L:text.html.basic",
"patterns": [
{
"comment": "Closing directive, both spellings: </?name?> and <?/name?>.",
"name": "meta.tag.template.close.hrml",
"match": "(</\\?|<\\?/)([\\w][\\w.-]*)\\s*(\\?>)",
"captures": {
"1": { "name": "punctuation.definition.tag.begin.hrml" },
"2": { "name": "entity.name.tag.hrml" },
"3": { "name": "punctuation.definition.tag.end.hrml" }
}
},
{
"comment": "Any opening directive or named-tag prop: <?word ...?>.",
"name": "meta.tag.template.hrml",
"begin": "(<\\?)([\\w][\\w.-]*)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.hrml" },
"2": { "name": "entity.name.tag.hrml" }
},
"end": "(/?\\?>)",
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.hrml" }
},
"patterns": [
{
"name": "entity.other.attribute-name.hrml",
"match": "\\b(file|id|as|cond|in|item|index|endpoint|method|cache|target|swap|post|get|scoped|global|slot|var|value|from|op|mode|formula|content|href|src|name|export|start|module|props|class|defer|over|by|count|order|where)\\b"
},
{
"name": "string.quoted.double.hrml",
"begin": "\"",
"end": "\"",
"patterns": [
{ "name": "constant.character.escape.hrml", "match": "\\\\." },
{ "name": "variable.other.hrml", "match": "(\\$)([\\w][\\w.-]*)" }
]
},
{
"name": "string.quoted.single.hrml",
"begin": "'",
"end": "'",
"patterns": [
{ "name": "constant.character.escape.hrml", "match": "\\\\." },
{ "name": "variable.other.hrml", "match": "(\\$)([\\w][\\w.-]*)" }
]
}
]
},
{
"comment": "$-prefixed references in HTML text content.",
"name": "variable.other.hrml",
"match": "(\\$)([\\w][\\w.-]*)"
}
]
}