From 96813a5e508a54257ef03be613a704f1f71af53d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 21 Oct 2023 00:25:50 -0400 Subject: Added quotes database --- app/helpers/quotes_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/helpers/quotes_helper.rb (limited to 'app/helpers/quotes_helper.rb') diff --git a/app/helpers/quotes_helper.rb b/app/helpers/quotes_helper.rb new file mode 100644 index 0000000..3c2acf9 --- /dev/null +++ b/app/helpers/quotes_helper.rb @@ -0,0 +1,11 @@ +module QuotesHelper + def quote_format(text) + text = text ? text.to_str : '' + text = text.dup if text.frozen? + 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 -- cgit 1.4.1