lite-xl/data/plugins/language_html.lua

40 lines
1.3 KiB
Lua
Raw Normal View History

2022-05-31 22:34:14 +02:00
-- mod-version:3
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",
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]%f[%s>].->",
"<%s*/%s*[sS][cC][rR][iI][pP][tT]%s*>"
},
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][tT][yY][lL][eE]%f[%s>].->",
2021-12-25 05:57:00 +01:00
"<%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 = {},
}