The issue of certain emojis displaying additional rectangles on iOS devices is discussed. nibl initially reports the problem and shares screenshots. Mittineague suggests it’s due to differences in iOS emoji, recommending the use of Discourse emojis instead.
nibl confirms the Discourse emojis work without issues, and speculates it might be a Unicode problem. Mittineague agrees, referencing a previous topic on the issue.
sam reports similar issues on Mac, not just iOS, and tags pmusaraj for assistance. pmusaraj identifies two separate issues: emoji conversion and extra squares after some emojis. They later discover that the issues are related and caused by the Unicode U+FE0F character, which confuses Safari and results in the rectangle display.
A pull request (#6456) aims to resolve the issue by trimming the U+FE0F character when replacing Unicode emojis. However, pmusaraj notes that this might break emojis when converted back to Unicode in certain situations.
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.