Created
June 16, 2011 15:28
-
-
Save spastorino/1029490 to your computer and use it in GitHub Desktop.
av.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb | |
| index 8f97eb7..df450cc 100644 | |
| --- a/actionpack/lib/action_view/helpers/text_helper.rb | |
| +++ b/actionpack/lib/action_view/helpers/text_helper.rb | |
| @@ -255,7 +255,7 @@ module ActionView | |
| # simple_format("<span>I'm allowed!</span> It's true.", {}, :sanitize => false) | |
| # # => "<p><span>I'm allowed!</span> It's true.</p>" | |
| def simple_format(text, html_options={}, options={}) | |
| - text = ''.html_safe if text.nil? | |
| + text = '' if text.nil? | |
| start_tag = tag('p', html_options, true) | |
| text = sanitize(text) unless options[:sanitize] == false | |
| text = text.to_str | |
| @@ -263,7 +263,7 @@ module ActionView | |
| 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 = ActiveSupport::SafeBuffer.new(text).safe_concat("</p>") | |
| + text.html_safe.safe_concat("</p>") | |
| end | |
| # Creates a Cycle object whose _to_s_ method cycles through elements of an |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment