mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
button_tag should escape it content
This commit is contained in:
parent
20897a6c2c
commit
1de47a0d56
2 changed files with 8 additions and 1 deletions
|
@ -457,7 +457,7 @@ module ActionView
|
|||
options[option] = "button" unless options[option]
|
||||
end
|
||||
|
||||
content_tag :button, label.to_s.html_safe, { "type" => options.delete("type") }.update(options)
|
||||
content_tag :button, label, { "type" => options.delete("type") }.update(options)
|
||||
end
|
||||
|
||||
# Displays an image which when clicked will submit the form.
|
||||
|
|
|
@ -413,6 +413,13 @@ class FormTagHelperTest < ActionView::TestCase
|
|||
)
|
||||
end
|
||||
|
||||
def test_button_tag_escape_content
|
||||
assert_dom_equal(
|
||||
%(<button name="button" type="reset" disabled="disabled"><b>Reset</b></button>),
|
||||
button_tag("<b>Reset</b>", :type => "reset", :disabled => true)
|
||||
)
|
||||
end
|
||||
|
||||
def test_image_submit_tag_with_confirmation
|
||||
assert_dom_equal(
|
||||
%(<input type="image" src="/images/save.gif" data-confirm="Are you sure?" />),
|
||||
|
|
Loading…
Reference in a new issue