Emoji not recognized after cyrillic symbols

Example:

Всегда можно уделить время туристу:slight_smile:

Renders as:

Всегда можно уделить время туристу:slight_smile:

Here, there is no space between the emoji code and the Russian word preceeding it.

Compare to English:

there’s always time to spend with a visitor:slightly_frowning_face:

Looks like it’s not recognized after latin words either.

Is thins a bug or by design?

Space is required in all languages for that to work.

Hm why? Plenty of people keep inserting smiles with no space. Requiring a space is not intuitive.

Is it fixable by changing a regex?

1 Like

My suggestion is to have the emoji picker inserts spaces. Either around or just before.

I have a huge problem with this also. It is worse because many of my users are Chinese and Chinese does t use spaces.

1 Like

Because otherwise, links like

https://www.discourse.org

would become

https:confused:/www.discourse.org
3 Likes

May we allow the no-space syntax for named emojis only?

So, only :confused: will work with no spaces, but not ://

No, @meglio, what @zogstrip mean is that:

:/ as well as :confused: both map to :confused:

Emoji’s start off as simple text-based combos like :-), :-o etc.

You have to be an old dog like myself to remember the times when we used text-based emoji’s on Unix talk.

So, there are a large number of combinations starting with a colon that may map into an emoji, but shouldn’t if it is not separated by a space (for example, the :/ above, when attached to http, should obviously mean http:// instead of an emoji). Without this space rule, the MarkDown processor has no way to tell if there should be an emoji or not.

So, my suggestion remain: automatically add a space in front (or both in front and after) the emoji, when chosen by the emoji picker.

Or, alternatively, modify the emoji processor to only recognize fully-spelt emoji names in non-space applications. For example: :/ is only recognized with a space before, but :confused: is always recognized wherever it is.

2 Likes

That’s exactly what I meant:

And because lots of emojis are inserted from the Emoji Dialog, there will be fully spelled versions used.

1 Like

Modifying the MarkDown processor may be a bit hairy…

My suggestion of adding a space in front of an emoji chosen from the emoji picker dialog requires simply changing one single line. MarkDown is mostly not space conscious, so adding an extra space in most places will do nothing to it.

Yes, one-liner solution to add an extra-space sounds reasonable. It will also make sense to only add it if it’s not there yet.

Btw, this is still a huge issue for us. Note how the Russian message in the image below spoiled with English emoji codes.

I now have to fix it manually (and ask my mods to do so), and it takes so much time, every single day.

2 Likes

I think we can make two changes to make this a little bit easier to use:

  • Emoji selector should insert a leading and trailing whitespace when it inserts an emoji.
  • Replacing of Unicode emojis should work even when there are no surrounding whitespaces.
    So, Hello🙂world should work the same as Hello 🙂 world and use the correct Emoji image from Discourse :slight_smile:.
3 Likes

I like this.
This happens a lot in my discourse site. My users forget to add a white-space before inserting emoji’s. I’m guessing its because they are not used to that - because in other platforms like whatsapp etc. its somehow taken care automatically.

@gerhard
Is it going to be a quick fix at Discourse end?
Or do you think this can be accomplished using CSS too?

1 Like

We can’t do the trailing one because of diversity level modifier :woman:t4: it would break the flow of selecting :woman: and then typing t to display the menu.

6 Likes

The trailing space is not needed. What’s critical is the leading space.

5 Likes

Hey @venarius,
is this something you’d like to improve given that you spent a lot of time fixing various Emoji issues lately?

4 Likes

I will look into it :slight_smile: Thanks for tagging!

5 Likes

Opened a PR :slight_smile:

Regarding

As far as I recognized it, this got added with the enable_inline_emoji_translations site setting. I noticed that emojiEscape and emojiUnescape didn’t support that site setting so I added it :slight_smile:

6 Likes

I picked up @venarius’ work and made some improvements. The most important changes are:

  • FIX: Prepends whitespace when inserting via emoji picker
  • FIX: Respect enable_inline_emoji_translation setting in topic titles

https://github.com/discourse/discourse/pull/8453

8 Likes