InteractionDesignFoundation / add-event-to-calendar-docs

📅 Docs how to generate links to add events to online calendar services
https://interactiondesignfoundation.github.io/add-event-to-calendar-docs/
MIT License
429 stars 57 forks source link

Ampersand in Subject for Outlook Web renders as & #17

Closed jaredlt closed 4 years ago

jaredlt commented 4 years ago

When I pass a Subject with an ampersand, it displays as &

Eg. Birthday & Sleepover percent-encoded to: &subject=Birthday%20%26%20Sleepover

Test link

image

This seems like a bug on Microsoft's side, but I wonder if you know of any hack that might get around it?

alies-dev commented 4 years ago

this is what they use:

if (params[SUBJECT_QUERYSTRING_KEY]) {
    event.Subject = HtmlSanitizer.sanitizeHtml(params[SUBJECT_QUERYSTRING_KEY]);
}

I assume there is no way to bypass it :/

jaredlt commented 4 years ago

@lptn Thanks for your speedy response! :)

It's weird as ampersands work fine in their Body (you'd think they'd use the same sanitizer everywhere...) 🤷‍♂️

I think I will detect and replace & with and in my gem (just for Outlook Web's Subject), as a workaround.