custom 'html' tags are in red color. Fixes #56467

This commit is contained in:
Martin Aeschlimann
2018-10-04 11:01:56 +02:00
parent 7ff8bda7e8
commit cfc2a2212d
7 changed files with 576 additions and 484 deletions

View File

@@ -0,0 +1,49 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/textmate/html.tmbundle/blob/master/Syntaxes/HTML%20%28Derivative%29.tmLanguage",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/textmate/html.tmbundle/commit/390c8870273a2ae80244dae6db6ba064a802f407",
"name": "HTML (Derivative)",
"scopeName": "text.html.derivative",
"injections": {
"R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*.html)": {
"comment": "Uses R: to ensure this matches after any other injections.",
"patterns": [
{
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
]
}
},
"patterns": [
{
"include": "text.html.basic#core-minus-invalid"
},
{
"begin": "(</?)(\\w[^\\s>]*)(?<!/)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
}
},
"end": "((?: ?/)?>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.other.unrecognized.html.derivative",
"patterns": [
{
"include": "text.html.basic#attribute"
}
]
}
]
}

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/textmate/html.tmbundle/commit/6a6fb2967e2f562a634fca97d18018104d428f1c",
"version": "https://github.com/textmate/html.tmbundle/commit/390c8870273a2ae80244dae6db6ba064a802f407",
"name": "HTML",
"scopeName": "text.html.basic",
"injections": {
@@ -20,55 +20,13 @@
},
"patterns": [
{
"begin": "(<\\?)(xml)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.html"
}
},
"end": "(\\?>)",
"name": "meta.tag.metadata.processing.xml.html",
"patterns": [
{
"include": "#attribute"
}
]
"include": "#xml-processing"
},
{
"include": "#comment"
},
{
"begin": "<!(?=(?i:DOCTYPE\\s))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.html"
}
},
"end": ">",
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.metadata.doctype.html",
"patterns": [
{
"match": "\\G(?i:DOCTYPE)",
"name": "entity.name.tag.html"
},
{
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.html"
},
{
"match": "[^\\s>]+",
"name": "entity.other.attribute-name.html"
}
]
"include": "#doctype"
},
{
"include": "#cdata"
@@ -468,6 +426,59 @@
}
]
},
"core-minus-invalid": {
"comment": "This should be the root pattern array includes minus #tags-invalid",
"patterns": [
{
"include": "#xml-processing"
},
{
"include": "#comment"
},
{
"include": "#doctype"
},
{
"include": "#cdata"
},
{
"include": "#tags-valid"
},
{
"include": "#entities"
}
]
},
"doctype": {
"begin": "<!(?=(?i:DOCTYPE\\s))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.html"
}
},
"end": ">",
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.metadata.doctype.html",
"patterns": [
{
"match": "\\G(?i:DOCTYPE)",
"name": "entity.name.tag.html"
},
{
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.html"
},
{
"match": "[^\\s>]+",
"name": "entity.other.attribute-name.html"
}
]
},
"entities": {
"patterns": [
{
@@ -2559,6 +2570,24 @@
]
}
]
},
"xml-processing": {
"begin": "(<\\?)(xml)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.html"
}
},
"end": "(\\?>)",
"name": "meta.tag.metadata.processing.xml.html",
"patterns": [
{
"include": "#attribute"
}
]
}
}
}