1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
David Heinemeier Hansson 2010-02-12 16:38:24 -08:00
parent dc3cc6c608
commit 325fa58ef5

View file

@ -332,7 +332,7 @@ module ActionView
text.gsub!(/\n\n+/, "</p>\n\n#{start_tag}") # 2+ newline -> paragraph text.gsub!(/\n\n+/, "</p>\n\n#{start_tag}") # 2+ newline -> paragraph
text.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br text.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
text.insert 0, start_tag text.insert 0, start_tag
text << "</p>" text.safe_concat("</p>")
end end
# Turns all URLs and e-mail addresses into clickable links. The <tt>:link</tt> option # Turns all URLs and e-mail addresses into clickable links. The <tt>:link</tt> option