summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelianiva <dicha.arkana03@gmail.com>2021-02-07 13:14:12 +0700
committerStephan Seitz <stephan.lauf@yahoo.de>2021-02-23 16:27:16 +0100
commit17a74e2055dcd80c5f8581320e56015350c1001f (patch)
treeab198f6f1fc2def89af6a1b71035ba57ff462ff3
parent46463fe53a8e817cbb93ab1337f4600c3c9b2ec0 (diff)
feat: improved highlight + injections, cc @stsewd
-rw-r--r--queries/svelte/highlights.scm26
-rw-r--r--queries/svelte/injections.scm5
2 files changed, 31 insertions, 0 deletions
diff --git a/queries/svelte/highlights.scm b/queries/svelte/highlights.scm
index f2f0b453..ecdfa931 100644
--- a/queries/svelte/highlights.scm
+++ b/queries/svelte/highlights.scm
@@ -4,6 +4,32 @@
(quoted_attribute_value) @string
(comment) @comment
+((element (start_tag (tag_name) @_tag) (text) @text.title)
+ (#match? @_tag "^(h[0-9]|title)$"))
+
+((element (start_tag (tag_name) @_tag) (text) @text.strong)
+ (#match? @_tag "^(strong|b)$"))
+
+((element (start_tag (tag_name) @_tag) (text) @text.emphasis)
+ (#match? @_tag "^(em|i)$"))
+
+((element (start_tag (tag_name) @_tag) (text) @text.strike)
+ (#match? @_tag "^(s|del)$"))
+
+((element (start_tag (tag_name) @_tag) (text) @text.underline)
+ (#match? @_tag "^u$"))
+
+((element (start_tag (tag_name) @_tag) (text) @text.literal)
+ (#match? @_tag "^(code|kbd)$"))
+
+((element (start_tag (tag_name) @_tag) (text) @text.uri)
+ (#match? @_tag "^a$"))
+
+((attribute
+ (attribute_name) @_attr
+ (quoted_attribute_value (attribute_value) @text.uri))
+ (#match? @_attr "^href$"))
+
[
(special_block_keyword)
(then)
diff --git a/queries/svelte/injections.scm b/queries/svelte/injections.scm
index 2e16b0d1..c63c31d0 100644
--- a/queries/svelte/injections.scm
+++ b/queries/svelte/injections.scm
@@ -1,6 +1,11 @@
((style_element
(raw_text) @css))
+((attribute
+ (attribute_name) @_attr
+ (quoted_attribute_value (attribute_value) @css))
+ (#match? @_attr "^style$"))
+
((script_element
(raw_text) @javascript))