From 76f949a6b2fbc21b1ad07e8da5ee56f59f1e91f4 Mon Sep 17 00:00:00 2001 From: Hayden Hargreaves Date: Tue, 7 Apr 2026 19:37:27 -0700 Subject: [PATCH] fix: fixed the html highlights --- internal/style/capture_theme.go | 12 ++++++------ internal/syntax/queries/html/highlights.scm | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/internal/style/capture_theme.go b/internal/style/capture_theme.go index 1b4b2ff..b1631d7 100644 --- a/internal/style/capture_theme.go +++ b/internal/style/capture_theme.go @@ -17,15 +17,15 @@ func CaptureStyle(base lipgloss.Style, capture string) lipgloss.Style { return base.Foreground(lipgloss.Color("#61afef")) case "function.builtin", "constructor", "keyword.return": return base.Foreground(lipgloss.Color("#ff5f5f")) - case "type", "type.builtin", "type.definition": + case "type", "type.builtin", "type.definition", "tag.attribute", "tag.attribute.url": return base.Foreground(lipgloss.Color("#e5c07b")) case "string", "string.escape": return base.Foreground(lipgloss.Color("#98c379")) - case "number", "number.float", "boolean", "constant", "constant.builtin": + case "number", "number.float", "boolean", "constant", "constant.builtin", "string.special.url": return base.Foreground(lipgloss.Color("#56b6c2")) - case "operator", "punctuation.delimiter", "punctuation.bracket": + case "operator", "punctuation.delimiter", "punctuation.bracket", "string.special": return base.Foreground(lipgloss.Color("#d19a66")) - case "comment", "comment.documentation": + case "comment", "comment.documentation", "tag.delimiter": return base.Foreground(lipgloss.Color("#7f848e")) case "variable.parameter": return base.Foreground(lipgloss.Color("#dcdfe4")).Italic(true) @@ -34,9 +34,9 @@ func CaptureStyle(base lipgloss.Style, capture string) lipgloss.Style { } switch baseName { - case "keyword": + case "keyword", "tag": return base.Foreground(lipgloss.Color("#c678dd")) - case "function": + case "function", "markup": return base.Foreground(lipgloss.Color("#61afef")) case "type": return base.Foreground(lipgloss.Color("#e5c07b")) diff --git a/internal/syntax/queries/html/highlights.scm b/internal/syntax/queries/html/highlights.scm index bab8da1..ea51c39 100644 --- a/internal/syntax/queries/html/highlights.scm +++ b/internal/syntax/queries/html/highlights.scm @@ -95,6 +95,10 @@ (attribute_value) @string.special.url)) (#any-of? @_attr "href" "src")) +((attribute + (attribute_name) @tag.attribute.url) + (#any-of? @tag.attribute.url "href" "src")) + [ "<" ">" @@ -103,3 +107,9 @@ ] @tag.delimiter "=" @operator + +(doctype) @constant + +"