Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is moved from RocketChat/Rocket.Chat#21833 , following the moved code.
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:
Issue(s)
Fixes RocketChat/Rocket.Chat#7386.
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.Pinging @MartinSchoeler as they implemented the initial version of the edited files in RocketChat/Rocket.Chat#19817 and therefore might be in a good position to provide input?