Skip to content

Commit

Permalink
allow more characters
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhawksley committed Jan 16, 2025
1 parent b3401c8 commit 1689205
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/calendar_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(
id: SecureRandom.hex
)
@id, @icon, @summary, @description, @location, @daily =
id, icon, summary.gsub(/[^a-zA-Z0-9\.\-\"\ ]/, ""), description, location, daily
id, icon, summary.gsub(/[^a-zA-Z0-9\.\-\"\ \_\/\\]/, ""), description, location, daily

@starts_at = case starts_at
when Integer
Expand Down
6 changes: 3 additions & 3 deletions test/models/calendar_event_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ def test_strips_emoji
assert_equal("foo", event.summary)
end

def test_does_not_strip_spaces
event = CalendarEvent.new(starts_at: "2023-11-01", ends_at: "2023-11-08", summary: "foo bar")
def test_does_not_strip_things_we_should_keep
event = CalendarEvent.new(starts_at: "2023-11-01", ends_at: "2023-11-08", summary: "foo bar / \\ ° - _")

assert_equal("foo bar", event.summary)
assert_equal("foo bar / \\ ° - _", event.summary)
end

def test_strips_non_ascii
Expand Down

0 comments on commit 1689205

Please sign in to comment.