Script element with type="text/html" not recognised as html. Fixes #25920

This commit is contained in:
Martin Aeschlimann 2017-05-08 12:52:13 +02:00
parent 63e81b33ca
commit 4a1c576f48
3 changed files with 1066 additions and 1 deletions

View file

@ -339,7 +339,7 @@
},
{
"begin": "\\G",
"end": "(?i:(?=/?>|type\\s*=\\s*('|\"|)(?!text/(javascript|ecmascript)|application/((x-)?javascript|ecmascript))\\b))",
"end": "(?i:(?=/?>|type\\s*=\\s*('|\"|)(?!text/(javascript|ecmascript)|application/((x-)?javascript|ecmascript)|module)\\b))",
"name": "meta.tag.metadata.script.html",
"patterns": [
{
@ -347,6 +347,44 @@
}
]
},
{
"begin": "(?=(?i:type\\s*=\\s*('|\"|)(?=text/(x-handlebars|(x-(handlebars-)?|ng-)?template|html))\\b))",
"end": "(<)(?=/(?i:script))",
"endCaptures": {
"0": {
"name": "meta.tag.metadata.script.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.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(?!\\G)",
"end": "(?=</(?i:script))",
"patterns": [
{
"include": "text.html.basic"
}
]
}
]
},
{
"begin": "(?=(?i:type))",
"end": "(<)(?=/(?i:script))",

View file

@ -0,0 +1,13 @@
<html>
<script type='text/html'>
<div class='foo'></div>
</script>
<script type='module'>
var x = 9;
</script>
<script type='text/ng-template'>
<div class='foo'></div>
</script>
<body class='bar'>
</body>
</html>

File diff suppressed because it is too large Load diff