mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #44585 from davekaro/remove_circle_void_element
Remove circle from HTML_VOID_ELEMENTS set.
This commit is contained in:
commit
13dd6f93c8
2 changed files with 10 additions and 2 deletions
|
@ -45,7 +45,7 @@ module ActionView
|
|||
include CaptureHelper
|
||||
include OutputSafetyHelper
|
||||
|
||||
HTML_VOID_ELEMENTS = %i(area base br col circle embed hr img input keygen link meta param source track wbr).to_set
|
||||
HTML_VOID_ELEMENTS = %i(area base br col embed hr img input keygen link meta param source track wbr).to_set
|
||||
SVG_SELF_CLOSING_ELEMENTS = %i(animate animateMotion animateTransform circle ellipse line path polygon polyline rect set stop use view).to_set
|
||||
|
||||
def initialize(view_context)
|
||||
|
|
|
@ -21,13 +21,21 @@ class TagHelperTest < ActionView::TestCase
|
|||
def test_tag_builder_void_tag
|
||||
assert_equal "<br>", tag.br
|
||||
assert_equal "<br class=\"some_class\">", tag.br(class: "some_class")
|
||||
assert_equal "<svg><use href=\"#cool-icon\" /></svg>", tag.svg { tag.use("href" => "#cool-icon") }
|
||||
end
|
||||
|
||||
def test_tag_builder_void_tag_with_forced_content
|
||||
assert_equal "<br>some content</br>", tag.br("some content")
|
||||
end
|
||||
|
||||
def test_tag_builder_self_closing_tag
|
||||
assert_equal "<svg><use href=\"#cool-icon\" /></svg>", tag.svg { tag.use("href" => "#cool-icon") }
|
||||
assert_equal "<svg><circle cx=\"5\" cy=\"5\" r=\"5\" /></svg>", tag.svg { tag.circle(cx: "5", cy: "5", r: "5") }
|
||||
end
|
||||
|
||||
def test_tag_builder_self_closing_tag_with_content
|
||||
assert_equal "<svg><circle><desc>A circle</desc></circle></svg>", tag.svg { tag.circle { tag.desc "A circle" } }
|
||||
end
|
||||
|
||||
def test_tag_builder_is_singleton
|
||||
assert_equal tag, tag
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue