From 931ddbb0779b0192e21ca7d15543f762b8b5a609 Mon Sep 17 00:00:00 2001 From: David Else <12832280+David-Else@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:26:19 +0100 Subject: [PATCH] Update HTML highlights (#11400) * Update HTML highlights * Update after review comments --- runtime/queries/html/highlights.scm | 36 +++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/runtime/queries/html/highlights.scm b/runtime/queries/html/highlights.scm index 99f39c95..5dd61b7c 100644 --- a/runtime/queries/html/highlights.scm +++ b/runtime/queries/html/highlights.scm @@ -1,13 +1,39 @@ (tag_name) @tag -(erroneous_end_tag_name) @tag.error +(erroneous_end_tag_name) @error (doctype) @constant (attribute_name) @attribute (comment) @comment -[ - "\"" - (attribute_value) -] @string +((attribute + (attribute_name) @_attr + (quoted_attribute_value (attribute_value) @markup.link.url)) + (#any-of? @_attr "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")) [ "<"