Rendering of ® in post results in ®

Reproduce:

  1. Reply to a topic and use ‘®’ in the body of the post.

Expected results:

  • The ‘®’ symbol appears in the post where desired.

Actual results - editor window:

Actual results - editor preview:

Actual results - rendered post:

3 Likes

Seeing the rendering here, suggests that it’s trying to be replaced with an emoji for some reason. (Why?!)

That said, for additional detail, we’re using the Twitter emoji set.

Thanks. That’s informative, but unfortunately doesn’t resolve the problem of not rendering correctly if (apparently) you aren’t using the EmojiOne set.

I believe this was updated with the new emoji updates, as my table of unicode chars -> emoji replacements grew. If people don’t like it we could remove it. What does everyone think?

@eviltrout I think the bug here is that we are not adding some space around things. So our replacer can leave you with broken markup, maybe add zero width space around emoji subs.

test:registered: :registered:

test:registered: :registered:

5 Likes

I definitely do not want the HTML entities replaced, e.g.

™ → ™
© → ©
® → ®

The above should not be using Emoji… nor should raw unicode, let’s try raw:

™ © ® → ™ © ®

Yeah that’s not desired. Replacing infinitely scaleable typographical font vectors with emoji images is Not Cool™

8 Likes

The issue though was😅 common to emojis as well☺

as well☺

as well☺

5 Likes

Okay, I’ve fixed both issues. Emoji replacements beside words will now work, and I no longer replace “TM, Copyright or Registered” automatically.

https://github.com/discourse/discourse/commit/616006a9ce40cbd6361e61db8ed5246863e65fba

4 Likes

Can you get away with a zero width space ?

I’m not sure if our emoji code supports that but this approach seems to work well enough.