Changed HTML plugin to have case insensitive matching of script and style tags.

This commit is contained in:
Adam Harrison 2021-05-01 14:52:39 -04:00
parent 1a05e00fdd
commit b69242312d
1 changed files with 13 additions and 3 deletions

View File

@ -5,17 +5,27 @@ syntax.add {
files = { "%.html?$" }, files = { "%.html?$" },
patterns = { patterns = {
{ {
pattern = { "<script type=['\"]%a+/javascript['\"]>", "</script>" }, pattern = {
"<%s*[sS][cC][rR][iI][pP][tT]%s+[tT][yY][pP][eE]%s*=%s*" ..
"['\"]%a+/[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]['\"]%s*>",
"<%s*/[sS][cC][rR][iI][pP][tT]>"
},
syntax = ".js", syntax = ".js",
type = "function" type = "function"
}, },
{ {
pattern = { "<script>", "</script>" }, pattern = {
"<%s*[sS][cC][rR][iI][pP][tT]%s*>",
"<%s*/%s*[sS][cC][rR][iI][pP][tT]>"
},
syntax = ".js", syntax = ".js",
type = "function" type = "function"
}, },
{ {
pattern = { "<style[^>]*>", "</style>" }, pattern = {
"<%s*[sS][tT][yY][lL][eE][^>]*>",
"<%s*/%s*[sS][tT][yY][lL][eE]%s*>"
},
syntax = ".css", syntax = ".css",
type = "function" type = "function"
}, },