Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some emojis (emoticons) break the MD parser #32577

Open
Lao-Ax opened this issue Jun 10, 2024 · 5 comments · May be fixed by #32717
Open

Some emojis (emoticons) break the MD parser #32577

Lao-Ax opened this issue Jun 10, 2024 · 5 comments · May be fixed by #32717
Labels
stat: triaged Issue reviewed and properly tagged type: bug

Comments

@Lao-Ax
Copy link

Lao-Ax commented Jun 10, 2024

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
@royjohnlee
Copy link

royjohnlee commented Jun 10, 2024

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

@Lao-Ax
Copy link
Author

Lao-Ax commented Jun 11, 2024

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
Copy link

reetp commented Jun 11, 2024

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.

#32544

@reetp reetp added type: bug stat: triaged Issue reviewed and properly tagged labels Jun 11, 2024
mrincrediblie pushed a commit to mrincrediblie/Rocket.Chat that referenced this issue Jul 2, 2024
…en using certain characters in bold, such as *text:*, the : caused a conflict, preventing the bold formatting from working correctly. I fixed the bug by modifying the message-parser (grammar.pegjs) and adding new rules.
mrincrediblie pushed a commit to mrincrediblie/Rocket.Chat that referenced this issue Jul 2, 2024
mrincrediblie pushed a commit to mrincrediblie/Rocket.Chat that referenced this issue Jul 2, 2024
mrincrediblie pushed a commit to mrincrediblie/Rocket.Chat that referenced this issue Jul 2, 2024
mrincrediblie pushed a commit to mrincrediblie/Rocket.Chat that referenced this issue Jul 2, 2024
Fix RocketChat#32577: Some emojis (emoticons) break the MD parser

fix of whitespace

Fix RocketChat#32577: Some emojis (emoticons) break the MD parser.
This was referenced Jul 3, 2024
@sudhidutta7694
Copy link

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
Copy link

reetp commented Jul 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: triaged Issue reviewed and properly tagged type: bug
Projects
None yet
4 participants