RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
39.98k stars 10.31k forks source link

Some emojis (emoticons) break the MD parser #32577

Open Lao-Ax opened 3 months ago

Lao-Ax commented 3 months ago

Description:

If you post a message like this one: *text:* you will not get a bold text or text with emoji. I suppose, there is a bug in a PEG grammar: see packages/message-parser/src/grammar.pegjs

Some where between rules Bold and Emoticon. The root of this case is :* - kissing_heart emoticon.

I've thired to figure out how this PEG works, but failed.

Steps to reproduce:

  1. Post a message *text:*

Expected behavior:

There is a bolded text text:

Actual behavior:

There is just a text. Note: If you post *text :* you will get *text and an emoji.

Server Setup Information:

Client Setup Information

royjohnlee commented 3 months ago

does it happen with just post? I'm interested in looking into this and working on it

Lao-Ax commented 3 months ago

What do you mean by "just post"? I meant "type and press submit". When you are editing such a text - there is the same error.

I've tried a banch of strategies and different grammars, but didn't susceed. I have a few tests but every time one of them fails :). Perhaps, it will help to someone.

1 :* // big emoji
2 *bold* // just bold
3 *bold :)* // bold with emoji 1
4 *bold :** // bold with emoji 2
5 *bold:* //  no emoji, just bold text
6 *:) bold* //bold with emoji 1
7 *:* bold* // bold with emoji 2 OR bolded ":"
8 * :) bold* //bold with emoji 1
9 * :* bold* //bold with emoji 2 OR bolded " :"
reetp commented 3 months ago

Thanks for opening this bug.

I suspect it is also related to this which is being looked at.

Whether it is a Rocket bug or a more generic limitation or parser bug I don't know.

https://github.com/RocketChat/Rocket.Chat/issues/32544

sudhidutta7694 commented 2 months ago

Hey there! I have setup Rocket.Chat locally and would like to work on this issue. Should I be assigned this issue in order to work in it?

reetp commented 2 months ago

Hey there! I have setup Rocket.Chat locally and would like to work on this issue. Should I be assigned this issue in order to work in it?

Issues are not assigned.

Please try what you want but be aware that someone else looks like they are working on it, and I believe the devs are on it in the background and it is likely fixed in 6.10

See the referenced bug above.