From 68c7982fcccb964d752ddf94afed106d3cb3160d Mon Sep 17 00:00:00 2001 From: Randy Schmidt Date: Wed, 29 Jun 2011 10:33:49 -0700 Subject: [PATCH] Fixed an error in Rails 3.0.9 where it gets angry if you try to modify a string in-place (Cannot modify SafeBuffer in place) --- lib/acts_as_sanitiled.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acts_as_sanitiled.rb b/lib/acts_as_sanitiled.rb index bd15816..3a45c40 100644 --- a/lib/acts_as_sanitiled.rb +++ b/lib/acts_as_sanitiled.rb @@ -115,7 +115,7 @@ def write_attribute(attr_name, value) private def strip_html(html) - html.gsub!(%r{

\n

}, "

\n\n

") # Workaround RedCloth 4.2.x issue + html = html.gsub(%r{

\n

}, "

\n\n

") # Workaround RedCloth 4.2.x issue Nokogiri::HTML::DocumentFragment.parse(html).inner_text end end