about summary refs log tree commit diff stats
path: root/app/helpers/quotes_helper.rb
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-10-21 00:25:50 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-10-21 00:25:50 -0400
commit96813a5e508a54257ef03be613a704f1f71af53d (patch)
treea50f5c8dc27304a3ca27366b6268a72804727e16 /app/helpers/quotes_helper.rb
parent2a7a19c93ee0e0d77e4e388d43f36a721c7ab715 (diff)
downloadthoughts-96813a5e508a54257ef03be613a704f1f71af53d.tar.gz
thoughts-96813a5e508a54257ef03be613a704f1f71af53d.tar.bz2
thoughts-96813a5e508a54257ef03be613a704f1f71af53d.zip
Added quotes database
Diffstat (limited to 'app/helpers/quotes_helper.rb')
-rw-r--r--app/helpers/quotes_helper.rb11
1 files changed, 11 insertions, 0 deletions
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 @@
1module QuotesHelper
2 def quote_format(text)
3 text = text ? text.to_str : ''
4 text = text.dup if text.frozen?
5 text.gsub!(/\r\n?/, "\n") # \r\n and \r -> \n
6 text.gsub!(/\n/, '<br />') # 1 newline -> br
7 text = sanitize(text)
8 text = auto_link(text, :link => :urls)
9 text
10 end
11end