From 27781a8a60ed3b19a633ba207af78765df3c685c Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Tue, 4 Mar 2025 08:12:25 +0100 Subject: [PATCH] html: Add injections for `style` attributes and event handler attributes (#23659) Closes #23653 Before: before After: after Release Notes: - N/A --- extensions/html/languages/html/injections.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extensions/html/languages/html/injections.scm b/extensions/html/languages/html/injections.scm index 1c31b2a0a9..0884d8f516 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"))