Unicode emoji modifiers are not being handled in the same way for topic titles and post content. In titles, they are displayed incorrectly.
For example:
Unicode emoji: π¨βπΎ
In post content: ![]()
Title: see title of this topic
The discussion addresses inconsistencies in how Unicode emoji modifiers are handled between topic titles and post content in Discourse. david first reports that emojis like π¨βπΎ display incorrectly in titles. venarius identifies the issue lies in the fancy_title function. j.jaffeux explains that a previous fix for emoji rendering was incomplete, and a PR (#7095) was intended to resolve it. venarius later opens a PR (#7156) to enhance emoji unescaping, which resolves the title issue. david notes that the issue persists in post content, where emojis like πββοΈ are incorrectly rendered due to an extra ββ character. venarius identifies a missing gender modifier in db.json and opens a PR (#7282) to fix it. j.jaffeux clarifies that the db.json update is straightforward and provides instructions for future updates, noting that some emojis were previously genderless and later updated with gender-specific versions.
Unicode emoji modifiers are not being handled in the same way for topic titles and post content. In titles, they are displayed incorrectly.
For example:
Unicode emoji: π¨βπΎ
In post content: ![]()
Title: see title of this topic
Is happening somewhere in fancy_title function in topic.rb
Will investigate further.
Oh I know why ![]()
This will be fixed by FEATURE: updates emoji to latest 12.0 version by jjaffeux Β· Pull Request #7095 Β· discourse/discourse Β· GitHub
Last year, I pushed last emojis before apple had updated the set, using another set for missing emojis.
Damn⦠And I thought it had something to do with unicode_unescape in emoji.rb converting the modifier to its two respective emojis.
<code>π¨‍πΎ</code> =>
![]()
So close and yet so far
![]()
The title is a different issue yes. Sorry didnt make it clear I was talking of the post content difference.
Opened a PR ![]()
https://github.com/discourse/discourse/pull/7156
With that fix also came an enhancement for the performEmojiUnescape function to now also support unicode emojis ![]()
This was merged, thanks @venarius - the topic titles look good now ![]()
On a related note, it seems that some Unicode emojis are not being converted properly in post content. Inserting the βwoman tipping handβ emoji from iOS results in this: ![]()
It seems to work correctly, but then inserts an extra ββ for some reason. It works fine in the topic title.
@david I will have a look at the post content
Thanks for the info!
Just noticed that it looks correctly in the title because the regex didnβt match on two emojis next to each other, which is why the emojis in the title are currently not escaped and thus the unicode emojis are directly rendered.
Just opened a PR for this.
https://github.com/discourse/discourse/pull/7282
Regarding this error I was able to notice that in lib/emoji/db.json there is
{
"code": "1f481",
"name": "tipping_hand_woman"
}
which should be
{
"code": "1f481-200d-2640-fe0f",
"name": "tipping_hand_woman"
}
@j.jaffeux is there an update needed for the db.json? If yes, I would love to take care of this ![]()
Hi tim,
sorry fixed it directly, itβs honestly not worth PRs and reviews, itβs a matter of copy/pasting few lines and running some rake tasks.
I can however explain you how it happened: previously some emojis were genderless, and then woman/man version were introduced. And if I remember correctly some of the genderless got the woman version and some the man version. Which is exactly what you found out.
If you find another one, here is the process:
And ![]()
![]()
This topic was automatically closed after 28 hours. New replies are no longer allowed.