module QuotesHelper
def quote_format(text)
text = text ? text.to_str : ''
text = text.dup if text.frozen?
text.gsub!(/^([\(\[][^\]\)]*[\]\)] )?([^:\n]*): /, "\\1\\2: ")
text.gsub!(/\r\n?/, "\n") # \r\n and \r -> \n
text.gsub!(/\n/, '
') # 1 newline -> br
text = sanitize(text)
text = auto_link(text, :link => :urls)
text
end
end