Skip to content

[Fix]: Calendar links breaking status - #3376

Merged
lvachon1 merged 4 commits into
mainfrom
lev/fix/alert_link_formatting
Jul 30, 2026
Merged

lvachon1 merged 4 commits into
mainfrom
lev/fix/alert_link_formatting

Conversation

@lvachon1

@lvachon1 lvachon1 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Scope

Asana Ticket: Investigate calendar links breaking status

Implementation

One of our alerts has a URL in the description that ends a line. Our text->HTML conversion functions were not properly separating the URL from the \r\n that came after it. Basically we split up everything by spaces and then parse each "token" to see if it's a URL. Without a space after the URL (spaces before newlines were stripped and replaced with a <br/>) the URL detector got something like http://example.com/path<br and that caused all sorts of havok.

This theory is proven by putting a space and a non-whitespace character after the URL in the alert. This forces the missing space before the newline to come and fixes the rest of the text->HTML flow

To fix this I tweaked our newline replacement rules to include a whitespace before the newline so that our "tokenizer" can actually separate the URL out.

Screenshots

Dev-green

Screenshot 2026-07-30 at 12 43 37 PM

Local

Screenshot 2026-07-30 at 1 22 02 PM

Note: Be sure to disable "Hide Whitespace" on github, this PR is nothing but whitespace.

How to test

Point local at dev green

http://localhost:4001/
http://localhost:4001/alerts/subway
http://localhost:4001/schedules/Green-C/line

Confirm that alert #1003815 renders properly, and that the link works as expected.

@lvachon1
lvachon1 requested a review from a team as a code owner July 30, 2026 17:28
@lvachon1
lvachon1 requested a review from jlucytan July 30, 2026 17:28
@lvachon1
lvachon1 merged commit 853eadf into main Jul 30, 2026
19 checks passed
@lvachon1
lvachon1 deleted the lev/fix/alert_link_formatting branch July 30, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants