lite-xl/data/plugins/language_html.lua

49 lines
1.5 KiB
Lua
Raw Normal View History

2021-08-17 15:46:21 +02:00
-- mod-version:2 -- lite-xl 2.0
2021-05-01 11:45:30 +02:00
local syntax = require "core.syntax"
syntax.add {
2021-11-21 03:46:43 +01:00
name = "HTML",
2021-05-01 11:45:30 +02:00
files = { "%.html?$" },
block_comment = { "<!--", "-->" },
2021-05-01 11:45:30 +02:00
patterns = {
2021-12-25 05:57:00 +01:00
{
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*>",
2021-12-25 05:57:00 +01:00
"<%s*/[sS][cC][rR][iI][pP][tT]>"
},
2021-12-25 05:57:00 +01:00
syntax = ".js",
type = "function"
2021-05-01 11:45:30 +02:00
},
2021-12-25 05:57:00 +01:00
{
pattern = {
"<%s*[sS][cC][rR][iI][pP][tT]%s*>",
2021-12-25 05:57:00 +01:00
"<%s*/%s*[sS][cC][rR][iI][pP][tT]>"
},
2021-05-01 11:45:30 +02:00
syntax = ".js",
type = "function"
},
2021-12-25 05:57:00 +01:00
{
pattern = {
"<%s*[sS][tT][yY][lL][eE][^>]*>",
"<%s*/%s*[sS][tT][yY][lL][eE]%s*>"
},
2021-05-01 11:45:30 +02:00
syntax = ".css",
type = "function"
},
{ pattern = { "<!%-%-", "%-%->" }, type = "comment" },
{ pattern = { '%f[^>][^<]', '%f[<]' }, type = "normal" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
{ pattern = "0x[%da-fA-F]+", type = "number" },
{ pattern = "-?%d+[%d%.]*f?", type = "number" },
{ pattern = "-?%.?%d+f?", type = "number" },
{ pattern = "%f[^<]![%a_][%w_]*", type = "keyword2" },
{ pattern = "%f[^<][%a_][%w_]*", type = "function" },
{ pattern = "%f[^<]/[%a_][%w_]*", type = "function" },
{ pattern = "[%a_][%w_]*", type = "keyword" },
{ pattern = "[/<>=]", type = "operator" },
},
symbols = {},
}