Permalink
Browse files

Make HTML escaping work as expected. Note: Don't get why the outer ht…

…ml_safe-call isn't enough. =S
  • Loading branch information...
grimen authored and josevalim committed Jul 23, 2010
1 parent bcc442b commit fb02665210426c5d87affe91d6f92a268b556693
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/simple_form/inputs/base.rb
@@ -39,7 +39,7 @@ def render
send(component)
end
content.compact!
- wrap(content.join).html_safe
+ wrap(content.join.html_safe).html_safe
end
protected

4 comments on commit fb02665

@adzap

This comment has been minimized.

Show comment Hide comment
@adzap

adzap Jul 23, 2010

It's because content_tag will escape any content string unless it is already marked html_safe. It uses the overridden ERB::Util.html_escape method which now checks for the html_safe flag first before escaping.

It's because content_tag will escape any content string unless it is already marked html_safe. It uses the overridden ERB::Util.html_escape method which now checks for the html_safe flag first before escaping.

@vinibaggio

This comment has been minimized.

Show comment Hide comment
@vinibaggio

vinibaggio Jul 23, 2010

Contributor

Nice!!! I was trying to fix that myself but couldn't find the source of the problem...

Contributor

vinibaggio replied Jul 23, 2010

Nice!!! I was trying to fix that myself but couldn't find the source of the problem...

@grimen

This comment has been minimized.

Show comment Hide comment
@grimen

grimen Jul 23, 2010

@adzap: OK, I didn't know that. Thanks for the expanation!

@vinibaggio: I was actually wondering if I was the only one. :)

@adzap: OK, I didn't know that. Thanks for the expanation!

@vinibaggio: I was actually wondering if I was the only one. :)

@vinibaggio

This comment has been minimized.

Show comment Hide comment
@vinibaggio

vinibaggio Jul 23, 2010

Contributor

@grimen: Thanks a lot!! :)

Contributor

vinibaggio replied Jul 23, 2010

@grimen: Thanks a lot!! :)

Please sign in to comment.