fix chained forum post quotes

This commit is contained in:
albert
2013-02-20 14:43:10 -05:00
parent fe443a29e3
commit a4ab27a6c6

View File

@@ -109,7 +109,8 @@ class ForumPost < ActiveRecord::Base
end
def quoted_response
"[quote]\n#{creator_name} said:\n#{body}\n[/quote]\n\n"
stripped_body = body.gsub(/\[quote\](?:.|\n|\r)+\[\/quote\][\n\r]*/m, "")
"[quote]\n#{creator_name} said:\n\n#{stripped_body}\n[/quote]\n\n"
end
def build_response