summaryrefslogtreecommitdiff
path: root/app/helpers/events_helper.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
commit8eab68f2c5a3c126e2fec2ecdfa7ace87ce0937b (patch)
treef446ebc26a7707c7b64a937aa51a155df146c80a /app/helpers/events_helper.rb
parent42714c697273a7117c6b355fab26c8c35e336ad1 (diff)
parentcdf5d9941ca866d437612d2f863eac6eb0b3db12 (diff)
Merge branch 'erdgeist-revive-events'
Diffstat (limited to 'app/helpers/events_helper.rb')
-rw-r--r--app/helpers/events_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index 8a9a878c..5e84f534 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -1,2 +1,13 @@
1require 'cgi'
2
1module EventsHelper 3module EventsHelper
4 # Insert a zero-width break opportunity after each semicolon, so a long
5 # RRULE can wrap at a clause boundary instead of overflowing its column.
6 # Deliberately <wbr>, not ellipsis -- unlike a URL, an RRULE's trailing
7 # characters (BYDAY, BYMONTH, etc.) are usually the most specific part,
8 # and truncating them would hide exactly the wrong end of the string.
9 def rrule_with_break_opportunities(rrule)
10 return "" if rrule.blank?
11 raw(rrule.split(';', -1).map { |part| CGI.escapeHTML(part) }.join(';<wbr>'))
12 end
2end 13end