From 1b5df893d82a27da907e9b8b75deff13179d1df3 Mon Sep 17 00:00:00 2001
From: "Eileen M. Uchitelle" <eileencodes@users.noreply.github.com>
Date: Thu, 5 May 2022 14:46:19 -0400
Subject: [PATCH] Merge pull request #45027 from
 rails/fix-tag-helper-regression

Fix tag helper regression
---
 actionview/test/template/tag_helper_test.rb                     | 2 ++
 .../lib/active_support/core_ext/string/output_safety.rb         | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/actionview/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb
index 2f53826c9c..21061181b8 100644
--- a/actionview/test/template/tag_helper_test.rb
+++ b/actionview/test/template/tag_helper_test.rb
@@ -168,6 +168,8 @@ def test_content_tag
                  content_tag(:p, "<script>evil_js</script>")
     assert_equal "<p><script>evil_js</script></p>",
                  content_tag(:p, "<script>evil_js</script>", nil, false)
+    assert_equal "<div @click=\"triggerNav()\">test</div>",
+                 content_tag(:div, "test", "@click": "triggerNav()")
   end
 
   def test_tag_builder_with_content
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index a7ae901585..0426d05f4d 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -13,7 +13,7 @@ module Util
     JSON_ESCAPE_REGEXP = /[\u2028\u2029&><]/u
 
     # Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name
-    TAG_NAME_START_REGEXP_SET = ":A-Z_a-z\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}" \
+    TAG_NAME_START_REGEXP_SET = "@:A-Z_a-z\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}" \
                                 "\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}" \
                                 "\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}"
     TAG_NAME_START_REGEXP = /[^#{TAG_NAME_START_REGEXP_SET}]/
-- 
2.30.2

