Modificadores de emoji Unicode são tratados de forma diferente em títulos e conteúdo de post 👨‍🌾 💁‍♀️

Os modificadores de emoji Unicode não estão sendo tratados da mesma maneira para títulos de tópicos e conteúdo de postagens. Nos títulos, eles são exibidos incorretamente.

Por exemplo:

Emoji Unicode: 👨‍🌾
No conteúdo da postagem: :man_farmer:
Título: veja o título deste tópico

13 curtidas

Is happening somewhere in fancy_title function in topic.rb

Will investigate further.

1 curtida

Oh I know why :stuck_out_tongue:

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.

11 curtidas

Damn… And I thought it had something to do with unicode_unescape in emoji.rb converting the modifier to its two respective emojis.

<code>👨&zwj;🌾</code> => :man: :ear_of_rice:

So close and yet so far :frowning: :smiley:

4 curtidas

The title is a different issue yes. Sorry didnt make it clear I was talking of the post content difference.

4 curtidas

Opened a PR :slight_smile:

With that fix also came an enhancement for the performEmojiUnescape function to now also support unicode emojis :partying_face:

6 curtidas

This was merged, thanks @venarius - the topic titles look good now :smiley:

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: :tipping_hand_woman:

It seems to work correctly, but then inserts an extra ‍♀ for some reason. It works fine in the topic title.

5 curtidas

@david I will have a look at the post content :slight_smile: Thanks for the info!

6 curtidas

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.

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 :slight_smile:

7 curtidas

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 :tada:

:woman_tipping_hand:

7 curtidas

This topic was automatically closed after 28 hours. New replies are no longer allowed.