Enable emoji shortcuts setting should allow escaping with backslashes

When the enable emoji shortcuts setting is enabled emoticons like :) get turned into actual emoji (:slight_smile:). However, this can’t be bypassed with a simple backslash before it (\:)). This is inconsistent with other things where escape works, and on Discord, you have a similar setting:

However it is not forced – if I want :-) raw I can just type a backslash before it, and I get what I want.

To bypass it you need to use something like a zero-width character in between, or wrap a letter in angle brackets in the middle since those don’t render, etc. i.e.

:<g>), :​)

which causes a bad ux for users who want a bit more freedom with how they write emoji.

8 Likes

This is not just shortcuts it is all emojis. I guess I am not against changing it so we stop emoji-ing if we have preceding \

So:

\:thinking: has parity with \`thinking` and \*thinking*

:thinking: has parity with `thinking` and *thinking*

5 Likes

I made a post about this on the roblox dev-forum which uses discourse, and I agree, having to always use empty characters, or anything to NOT use an emoji is kind of annoying; Emojis usually make your post a bit more unprofessional, and sometimes you want a little :) but you don’t want a :slight_smile:

I hope this gets changed, (“I guess it woudn’t update since it’s open-source and everything;”)

Actually I found this topic because I just stumbled into this inquiry myself (tried to escape a smiley but alas, it turned into an emoji AND swallowed my escape character … the audacity, ahah)

We have an existing bypass for this in backtick, e.g. :-) and :) … plus code blocks … not really sure we need even more methods to achieve the same goal?

My point was more of using emoji in actual conversation, and wouldn’t it just be a matter of not rendering the emoji, keeping it as an emoticon if there is a backslash before it ?

`` are for inline code, if you’re not having a programming discussion using code blocks doesn’t make sense. Even if it was it still doesn’t make sense as inline codes are generally used for highlighting a single line of code or for highlighting class/member names and such.

1 Like

Not so – HTML will try to render if you type <a> for example. So inline code blocks are the expected way to render that.

Just not sure I want to spend valuable engineering time on something that we already have a way of handling.

I am putting PR welcome on this, had a 15 minute look at this and there is no trivial fix.

Our parser eats the escape code so by the time we have it we have no idea the escape was there.

Whatever fix exists here it will involve hacking markdown.it and upstreaming a patch. Very very complicated … cc @Vitaly

Same issue at https://markdown-it.github.io/

Recommend you open a ticket upstream, though this may mean we need to annotate text tokens with “original raw for the text token”.

Difficulty level on this is about 95.

4 Likes

This bug has the similar design miss as “underscores can break autolinks”, but may be specific kludge possible. I will take a look what can be done.

Created issue: Postpone escape info drop · Issue #840 · markdown-it/markdown-it · GitHub

2 Likes

I must wholeheartedly disagree. “:)” is simply not the same as “:)”.

Still, I do agree that this is not something to waste time/money on. Annoying, but understandable.

Looks like @Vitaly fixed in v13, we will upgrade to it

2 Likes

A user in my forum complained about this formatting issue, I’ve disabled emoji autocomplete as the fix for our use case, but since discourse upgraded to markdown-it v13 a while back the issue seemed to persist whereas backslash-escape now works on https://markdown-it.github.io/

Could this be because ember.js is still relying on markdown v12 as indicated here?

We are on 13 now afaik… cc @david and issue remains.

Looks like we have our own Emoji implementation - we don’t use the markdown-it one.

(shortcuts defined here, referenced here. Replacement logic is here)

3 Likes

Oh so this should be rather straightforward to fix (famous last words)

I’m beginning work on this now. :slight_smile:

Edit: This may be harder than I thought. :upside_down_face:

2 Likes