Skip to content

Commit 68c7982

Browse files
committed
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)
1 parent 2607117 commit 68c7982

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/acts_as_sanitiled.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def write_attribute(attr_name, value)
115115

116116
private
117117
def strip_html(html)
118-
html.gsub!(%r{</p>\n<p>}, "</p>\n\n<p>") # Workaround RedCloth 4.2.x issue
118+
html = html.gsub(%r{</p>\n<p>}, "</p>\n\n<p>") # Workaround RedCloth 4.2.x issue
119119
Nokogiri::HTML::DocumentFragment.parse(html).inner_text
120120
end
121121
end

0 commit comments

Comments
 (0)