diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-21 00:25:50 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-21 00:25:50 -0400 |
commit | 96813a5e508a54257ef03be613a704f1f71af53d (patch) | |
tree | a50f5c8dc27304a3ca27366b6268a72804727e16 /app/helpers | |
parent | 2a7a19c93ee0e0d77e4e388d43f36a721c7ab715 (diff) | |
download | thoughts-96813a5e508a54257ef03be613a704f1f71af53d.tar.gz thoughts-96813a5e508a54257ef03be613a704f1f71af53d.tar.bz2 thoughts-96813a5e508a54257ef03be613a704f1f71af53d.zip |
Added quotes database
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/quotes_helper.rb | 11 |
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 @@ | |||
1 | module 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 | ||
11 | end | ||