Skip to content
Browse files

Don't operate on the safebuffer, operate on a string and convert.

  • Loading branch information...
1 parent 1300c03 commit ef8b12a29e27ea01547779cb3a45b60ff90816b4 @cmeiklejohn cmeiklejohn committed Jun 7, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 actionpack/lib/action_view/helpers/text_helper.rb
View
3 actionpack/lib/action_view/helpers/text_helper.rb
@@ -258,11 +258,12 @@ def simple_format(text, html_options={}, options={})
text = ''.html_safe if text.nil?
start_tag = tag('p', html_options, true)
text = sanitize(text) unless options[:sanitize] == false
+ text = text.to_str
text.gsub!(/\r\n?/, "\n") # \r\n and \r -> \n
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.html_safe.safe_concat("</p>")
+ text = ActiveSupport::SafeBuffer.new(text).safe_concat("</p>")
end
# Creates a Cycle object whose _to_s_ method cycles through elements of an

0 comments on commit ef8b12a

Please sign in to comment.
Something went wrong with that request. Please try again.