54 lines
61 KiB
JavaScript
54 lines
61 KiB
JavaScript
|
import javascript from './javascript.mjs';
|
||
|
import css from './css.mjs';
|
||
|
|
||
|
const lang = Object.freeze({ "displayName": "HTML", "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" }] } }, "name": "html", "patterns": [{ "include": "#xml-processing" }, { "include": "#comment" }, { "include": "#doctype" }, { "include": "#cdata" }, { "include": "#tags-valid" }, { "include": "#tags-invalid" }, { "include": "#entities" }], "repository": { "attribute": { "patterns": [{ "begin": "(s(hape|cope|t(ep|art)|ize(s)?|p(ellcheck|an)|elected|lot|andbox|rc(set|doc|lang)?)|h(ttp-equiv|i(dden|gh)|e(ight|aders)|ref(lang)?)|n(o(nce|validate|module)|ame)|c(h(ecked|arset)|ite|o(nt(ent(editable)?|rols)|ords|l(s(pan)?|or))|lass|rossorigin)|t(ype(mustmatch)?|itle|a(rget|bindex)|ranslate)|i(s(map)?|n(tegrity|putmode)|tem(scope|type|id|prop|ref)|d)|op(timum|en)|d(i(sabled|r(name)?)|ownload|e(coding|f(er|ault))|at(etime|a)|raggable)|usemap|p(ing|oster|la(ysinline|ceholder)|attern|reload)|enctype|value|kind|for(m(novalidate|target|enctype|action|method)?)?|w(idth|rap)|l(ist|o(op|w)|a(ng|bel))|a(s(ync)?|c(ce(sskey|pt(-charset)?)|tion)|uto(c(omplete|apitalize)|play|focus)|l(t|low(usermedia|paymentrequest|fullscreen))|bbr)|r(ows(pan)?|e(versed|quired|ferrerpolicy|l|adonly))|m(in(length)?|u(ted|ltiple)|e(thod|dia)|a(nifest|x(length)?)))(?![\\w:-])", "beginCaptures": { "0": { "name": "entity.other.attribute-name.html" } }, "comment": "HTML5 attributes, not event handlers", "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.$1.html", "patterns": [{ "include": "#attribute-interior" }] }, { "begin": "style(?![\\w:-])", "beginCaptures": { "0": { "name": "entity.other.attribute-name.html" } }, "comment": "HTML5 style attribute", "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.style.html", "patterns": [{ "begin": "=", "beginCaptures": { "0": { "name": "punctuation.separator.key-value.html" } }, "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", "patterns": [{ "begin": "(?=[^\\s=<>`/]|/(?!>))", "end": "(?!\\G)", "name": "meta.embedded.line.css", "patterns": [{ "captures": { "0": { "name": "source.css" } }, "match": "([^\\s\"'=<>`/]|/(?!>))+", "name": "string.unquoted.html" }, { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.html" } }, "contentName": "source.css", "end": '(")', "endCaptures": { "0": { "name": "punctuation.definition.string.end.html" }, "1": { "name": "source.css" } }, "name": "string.quoted.double.html", "patterns": [{ "include": "#entities" }] }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.html" } }, "contentName": "source.css", "end": "(')", "endCaptures": { "0": { "name": "punctuation.definition.string.end.html" }, "1": { "name": "source.css" } }, "name": "string.quoted.single.html", "patterns": [{ "include": "#entities" }] }] }, { "match": "=", "name": "invalid.illegal.unexpected-equals-sign.html" }] }] }, { "begin": "on(s(croll|t(orage|alled)|u(spend|bmit)|e(curitypolicyviolation|ek(ing|ed)|lect))|hashchange|c(hange|o(ntextmenu|py)|u(t|echange)|l(ick|ose)|an(cel|play(through)?))|t(imeupdate|oggle)|in(put|valid)|o(nline|ffline)|d(urationchange|r(op|ag(start|over|e(n(ter|d)|xit)|leave)?)|blclick)|un(handledrejection|load)|p(opstate|lay(ing)?|a(ste|use|ge(show|hide))|rogress)|e(nded|rror|mptied)|volumechange|key(down|up|press)|focus|w(heel|aiting)|l(oad(start|e(nd|d(data|metadata)))?|anguagechange)|a(uxclick|fterprint|bort)|r(e(s(ize|et)|jectionhandled)|atechange)|m(ouse(o(ut|ver)|down|up|enter|leave|move)|essage(error)?)|b(efore(unload|print)|lur))(?![\\w:-])", "beginCaptures": { "0": { "name": "entity.other.attribute-name.html" } }, "comment": "HTML5 attributes, event handlers", "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.event-handler.$1.html", "patterns": [{ "begin": "=", "beginCaptures": { "0": { "name": "punctuation.separator.key-value.html" } }, "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", "patterns": [{
|
||
|
(?=>
|
||
|
| type(?=[\\s=])
|
||
|
(?!\\s*=\\s*
|
||
|
(
|
||
|
''
|
||
|
| ""
|
||
|
| ('|"|)
|
||
|
(
|
||
|
text/
|
||
|
(
|
||
|
javascript(1\\.[0-5])?
|
||
|
| x-javascript
|
||
|
| jscript
|
||
|
| livescript
|
||
|
| (x-)?ecmascript
|
||
|
| babel
|
||
|
|
||
|
)
|
||
|
| application/
|
||
|
(
|
||
|
(x-)?javascript
|
||
|
| (x-)?ecmascript
|
||
|
)
|
||
|
| module
|
||
|
)
|
||
|
[\\s"'>]
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
)`, "name": "meta.tag.metadata.script.start.html", "patterns": [{ "include": "#attribute" }] }, { "begin": `(?ix:
|
||
|
(?=
|
||
|
type\\s*=\\s*
|
||
|
('|"|)
|
||
|
text/
|
||
|
(
|
||
|
x-handlebars
|
||
|
| (x-(handlebars-)?|ng-)?template
|
||
|
| html
|
||
|
)
|
||
|
[\\s"'>]
|
||
|
)
|
||
|
)`, "end": "((<))(?=/(?i:script))", "endCaptures": { "0": { "name": "meta.tag.metadata.script.end.html" }, "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "text.html.basic" } }, "patterns": [{ "begin": "\\G", "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.metadata.script.start.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?!\\G)", "end": "(?=</(?i:script))", "name": "text.html.basic", "patterns": [{ "include": "text.html.basic" }] }] }, { "begin": "(?=(?i:type))", "end": "(<)(?=/(?i:script))", "endCaptures": { "0": { "name": "meta.tag.metadata.script.end.html" }, "1": { "name": "punctuation.definition.tag.begin.html" } }, "patterns": [{ "begin": "\\G", "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.metadata.script.start.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?!\\G)", "end": "(?=</(?i:script))", "name": "source.unknown" }] }] }] }] }, { "begin": "(?i)(<)(base|link|meta)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.metadata.$2.void.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(<)(noscript|title)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": ">", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.metadata.$2.start.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(</)(noscript|title)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": ">", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.metadata.$2.end.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(<)(col|hr|input)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.structure.$2.void.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(<)(address|article|aside|blockquote|body|button|caption|colgroup|datalist|dd|details|dialog|div|dl|dt|fieldset|figcaption|figure|footer|form|head|header|hgroup|html|h[1-6]|label|legend|li|main|map|menu|meter|nav|ol|optgroup|option|output|p|pre|progress|section|select|slot|summary|table|tbody|td|template|textarea|tfoot|th|thead|tr|ul)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": ">", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.structure.$2.start.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(</)(address|article|aside|blockquote|body|button|caption|colgroup|datalist|dd|details|dialog|div|dl|dt|fieldset|figcaption|figure|footer|form|head|header|hgroup|html|h[1-6]|label|legend|li|main|map|menu|meter|nav|ol|optgroup|option|output|p|pre|progress|section|select|slot|summary|table|tbody|td|template|textarea|tfoot|th|thead|tr|ul)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": ">", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.structure.$2.end.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(<)(area|br|wbr)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.html" }, "2": { "name": "entity.name.tag.html" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.html" } }, "name": "meta.tag.inline.$2.void.html", "patterns": [{ "include": "#attribute" }] }, { "begin": "(?i)(<)(
|
||
|
var html = [
|
||
|
...javascript,
|
||
|
...css,
|
||
|
lang
|
||
|
];
|
||
|
|
||
|
export { html as default };
|