diff options
| author | Katrina Grace <kat@swordglowsblue.com> | 2022-06-22 20:56:41 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-22 22:56:41 -0400 |
| commit | beefb164697a5aae81c0ee8f24331a44fa8893cf (patch) | |
| tree | 9e3b102609d80d21a64c113d6a1f3508f4c4f49d /data/plugins/language_html.lua | |
| parent | 880e6e4f0fac1287f93eeb9eeaaca538ccc2aa52 (diff) | |
| download | lite-xl-beefb164697a5aae81c0ee8f24331a44fa8893cf.tar.gz lite-xl-beefb164697a5aae81c0ee8f24331a44fa8893cf.zip | |
language_html: Improve subsyntax highlighting (#1043)
* language_html: Improve subsyntax highlighting
- Adjusted `<script>`/`<style>` tag detection to not break when attributes like `defer` are added
Diffstat (limited to 'data/plugins/language_html.lua')
| -rw-r--r-- | data/plugins/language_html.lua | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/data/plugins/language_html.lua b/data/plugins/language_html.lua index 0e714f6c..0d61819e 100644 --- a/data/plugins/language_html.lua +++ b/data/plugins/language_html.lua @@ -3,29 +3,20 @@ local syntax = require "core.syntax" syntax.add { name = "HTML", - files = { "%.html?$" }, + files = { "%.html?$" }, block_comment = { "<!--", "-->" }, patterns = { { 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]>" + "<%s*[sS][cC][rR][iI][pP][tT]%f[%s>].->", + "<%s*/%s*[sS][cC][rR][iI][pP][tT]%s*>" }, syntax = ".js", type = "function" }, { pattern = { - "<%s*[sS][cC][rR][iI][pP][tT]%s*>", - "<%s*/%s*[sS][cC][rR][iI][pP][tT]>" - }, - syntax = ".js", - type = "function" - }, - { - pattern = { - "<%s*[sS][tT][yY][lL][eE][^>]*>", + "<%s*[sS][tT][yY][lL][eE]%f[%s>].->", "<%s*/%s*[sS][tT][yY][lL][eE]%s*>" }, syntax = ".css", |
