diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-06-16 12:46:11 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-06-16 12:46:11 -0300 |
commit | eedbe1c827beb17f60c479bdf08b25e4f8d2c0e4 (patch) | |
tree | 6084e6ab467e6a33ad1a1f9bf94346109feae1ea /actionpack/lib/action_view | |
parent | f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3 (diff) | |
download | rails-eedbe1c827beb17f60c479bdf08b25e4f8d2c0e4.tar.gz rails-eedbe1c827beb17f60c479bdf08b25e4f8d2c0e4.tar.bz2 rails-eedbe1c827beb17f60c479bdf08b25e4f8d2c0e4.zip |
Use html_safe
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 8f97eb7d75..df450cc836 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 |