Browse files

Safely concat the ending tag to simple_format or it will be escaped

  • Loading branch information...
1 parent dc3cc6c commit 325fa58ef585b4303a41270e231918f298ee30bd @dhh dhh committed Feb 12, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/text_helper.rb
View
2 actionpack/lib/action_view/helpers/text_helper.rb
@@ -332,7 +332,7 @@ def simple_format(text, html_options={})
text.gsub!(/\n\n+/, "</p>\n\n#{start_tag}") # 2+ newline -> paragraph
text.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
text.insert 0, start_tag
- text << "</p>"
+ text.safe_concat("</p>")
end
# Turns all URLs and e-mail addresses into clickable links. The <tt>:link</tt> option

1 comment on commit 325fa58

Please sign in to comment.