Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Some emojis (emoticons) break the MD parser

Open Lao-Ax opened this issue 1 year ago • 5 comments

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:

  • Version of Rocket.Chat Server: 6.9.0 and erlier
  • Operating System: any
  • Deployment Method: any
  • Number of Running Instances: any
  • NodeJS Version: 14.21.3
  • MongoDB Version: 7.3

Client Setup Information

  • Desktop App or Browser Version: any
  • Operating System: any

Lao-Ax avatar Jun 10 '24 14:06 Lao-Ax

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

royjohnlee avatar Jun 10 '24 22:06 royjohnlee

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

Lao-Ax avatar Jun 11 '24 09:06 Lao-Ax

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

reetp avatar Jun 11 '24 09:06 reetp

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?

sudhidutta7694 avatar Jul 06 '24 13:07 sudhidutta7694

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.

reetp avatar Jul 06 '24 17:07 reetp