Certain emojis display a rectangle after the image. Does anyone know the cause for this?
I’ve attached two screenshots below. One shows the emojis when writing a new post, the second what happens after posting.
I’m running version 2.0.0 beta 6 of Discourse. The emoji set is Apple/International.
Test: happy little and happy little .
Hmm, it’s happening on here too. At least for me viewing on an iOS device.
Thanks, just tested. Indeed, the Discourse emoji work as expected, without any additional rectangles.
Out of curiosity, is this some kind of Unicode issue where the two systems don’t know how to interpret the codes?
I just came across this today when posting (this is actually from a Mac now, this is not iOS specific, it is Emoji code -> Emoji conversion)
@pmusaraj can you have a look at this?
Also see: What is the problem with PrettyText.markdown call?
It turns out the two issues are related. Some emojis include the Unicode
U+FE0F character, which is the VARIATION SELECTOR-16 selector, an “invisible codepoint which specifies that the preceding character should be displayed with emoji presentation”. Since the preceding code point is turned into an image, Safari gets confused, and it displays this rectangle instead.
Note that the PR trims
U+FE0F when replacing unicode emojis but I wonder whether it breaks emojis when they get converted back to Unicode in push notifications and the like.