Skip to content

Commit

Permalink
Merge pull request #45027 from rails/fix-tag-helper-regression
Browse files Browse the repository at this point in the history
Fix tag helper regression
  • Loading branch information
eileencodes committed May 5, 2022
1 parent cd7700b commit 082e929
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions actionview/test/template/tag_helper_test.rb
Expand Up @@ -201,6 +201,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
Expand Down
Expand Up @@ -12,7 +12,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}]/
Expand Down

0 comments on commit 082e929

Please sign in to comment.