Skip to content

Commit

Permalink
Safely concat the ending tag to simple_format or it will be escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Feb 13, 2010
1 parent dc3cc6c commit 325fa58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/text_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 325fa58

@joseicosta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.