From 0f15130ae2f3fecba66b7f99576b605325dc8a93 Mon Sep 17 00:00:00 2001 From: uncenter Date: Mon, 16 Jun 2025 07:46:30 -0400 Subject: [PATCH] Replace inherits with existing HTML highlights --- runtime/queries/astro/highlights.scm | 47 +++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/runtime/queries/astro/highlights.scm b/runtime/queries/astro/highlights.scm index 3d0792b84..780ed3304 100644 --- a/runtime/queries/astro/highlights.scm +++ b/runtime/queries/astro/highlights.scm @@ -1,3 +1,48 @@ -; inherits: html +(tag_name) @tag +(erroneous_end_tag_name) @error +(doctype) @constant +(attribute_name) @attribute +(comment) @comment + +((attribute + (attribute_name) @attribute + (quoted_attribute_value (attribute_value) @markup.link.url)) + (#any-of? @attribute "href" "src")) + +((element + (start_tag + (tag_name) @tag) + (text) @markup.link.label) + (#eq? @tag "a")) + +(attribute [(attribute_value) (quoted_attribute_value)] @string) + +((element + (start_tag + (tag_name) @tag) + (text) @markup.bold) + (#any-of? @tag "strong" "b")) + +((element + (start_tag + (tag_name) @tag) + (text) @markup.italic) + (#any-of? @tag "em" "i")) + +((element + (start_tag + (tag_name) @tag) + (text) @markup.strikethrough) + (#any-of? @tag "s" "del")) + +[ + "<" + ">" + "" + "