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] Escape trademark sign #21833

Closed
wants to merge 1 commit into from
Closed

Conversation

2xB
Copy link

@2xB 2xB commented Apr 27, 2021

Checklist remark

Since this change is so small, repeating existing patterns and I currently don't have a test environment set up, I dared to not test it on my local machine and hope when reviewing this, it doesn't provide significant additional work to test this insignificant fix.

Proposed changes (including videos or screenshots)

Before this, the trademark character (™) was automatically replaced with ™️ , showing the trademark symbol in a totally unfitting size for most contexts. This commit avoids that by replacing the sign with its HTML escaped version before further replacements e.g. via emojione are applied (as can be seen in Rocket.Chat/client/lib/renderMessageBody.ts).

This is identical to how e.g. the registered trademark sign is currently handled.

Before fix:
image

Issue(s)

Fixes #7386.

Steps to test or reproduce

Send the following message:

™ example
® example

Further comments

Escaping symbols like ® in escapeHTML already looks like a workaround around a bug in emojione/https://github.com/RocketChat/Rocket.Chat/blob/develop/app/emoji-emojione/lib/rocketchat.js for me, since I don't know of an other reason to escape these characters this way other than preventing emojione from picking them up. Since this is the approach that is already in use, I just continue this approach logically for one more symbol.

Before this, the trademark character (™) was automatically replaced with ™️ ,
showing the trademark symbol in a totally unfitting size for most contexts.
This commit avoids that by replacing the sign with its HTML escaped version
before further replacements e.g. via emojione are applied
(as can be seen in `Rocket.Chat/client/lib/renderMessageBody.ts`).

This is identical to how e.g. the registered trademark sign is currently handled.

Fixes RocketChat#7386.
@2xB 2xB closed this Jul 15, 2021
@2xB
Copy link
Author

2xB commented Jul 15, 2021

Moved to RocketChat/fuselage#500.

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.

Add option to not use ™️ icon for ™ character
1 participant