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

New handling way for HTML entities #45

Closed
yhatt opened this issue Aug 13, 2019 · 0 comments · Fixed by #47
Closed

New handling way for HTML entities #45

yhatt opened this issue Aug 13, 2019 · 0 comments · Fixed by #47

Comments

@yhatt
Copy link
Owner

yhatt commented Aug 13, 2019

Luckily escaping and decoding HTML entities in the current jsx-slack stands on a fine balance, but it's just like riding on a rolling ball.

Currentlly we escape string to HTML entity by heuristic parsing, but sometimes it would return unexpected result. We had not determined a specification handling entities, so there are some issues on to express the creative message.

I had tried to fix partially in #16 and #33, but I noticed to have to determine a new way of handling HTML entities.

New specifications

Because Slack does not provide a correct way to escape most characters, jsx-slack will continue to allow using raw characters to format message, like *, _, ~, and so on. However, some special characters, <, >, and & in the string, will always escape to HTML entities.

It means that raw mrkdwns like <!channel> and <https://example.com/|hyperlink> would not work under the new specification. Slack just would show an original text as you wrote. In most cases, this is an expected behavior and safer than before. Just use <a> HTML tag to use hyperlink.

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 a pull request may close this issue.

1 participant