Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

html: Add injections for `style` attributes and event handler attributes (#23659)

Finn Evers27781a8a60ed
diff --git a/extensions/html/languages/html/injections.scm b/extensions/html/languages/html/injections.scm
index 1c31b2a0a95..0884d8f5167 100644
--- a/extensions/html/languages/html/injections.scm
+++ b/extensions/html/languages/html/injections.scm
@@ -5,3 +5,13 @@
(style_element
(raw_text) @injection.content
(#set! injection.language "css"))
+
+(attribute
+ (attribute_name) @_attribute_name (#match? @_attribute_name "^style$")
+ (quoted_attribute_value (attribute_value) @injection.content)
+ (#set! injection.language "css"))
+
+(attribute
+ (attribute_name) @_attribute_name (#match? @_attribute_name "^on[a-z]+$")
+ (quoted_attribute_value (attribute_value) @injection.content)
+ (#set! injection.language "javascript"))