Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix escaping for Slack #21

Merged
merged 1 commit into from
Sep 24, 2023
Merged

Conversation

jburianek
Copy link
Contributor

Slack doesn't want all HTML entities escaped, only &, <, and >.
https://api.slack.com/reference/surfaces/formatting#escaping

You shouldn't HTML entity-encode the entire text, as only the specific characters shown above will be decoded for display in Slack.

But marked seems to assume we want HTML output.

To work around this, override the tokenizer's inlineText method with one that only escapes those 3 characters.

This fixes the issue where We've allocated displays as We&#39;ve allocated in Slack.

@jburianek
Copy link
Contributor Author

cc: @marissamarym @EndBug

@marissamarym
Copy link
Contributor

Thanks @jburianek!

@marissamarym marissamarym merged commit 5dc0226 into tryfabric:master Sep 24, 2023
3 checks passed
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