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

fix: room chat - whisper displays 1 mention when 2 mentions are send in specific way #804

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ExpensiMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export default class ExpensiMark {
{
name: 'reportMentions',

regex: /(?<![^ \n*~_])(#[\p{Ll}0-9-]{1,99})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
regex: /(?<![^ \n*~_-])(#[\p{Ll}0-9]{1,99})(?![^<]*(?:<\/pre>|<\/code>|<\/a>))/gimu,
Copy link
Contributor Author

@NJ-2020 NJ-2020 Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove the minus sign - after 0-9 because it will match any word containing minus sign - meaning

If we not remove the minus sign - and we type #user1-#user2 the output will be:
#user1- #user2

After removing:
#user1 #user2

Copy link
Contributor Author

@NJ-2020 NJ-2020 Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we remove the - minus sign it will cause other issue like:
typing #room-test the mention-report tag will only wrap #room

But if we don't remove the - minus sign it will show like this #user1- #user2 if we type #user1-#user2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failling actually

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because the minus sign is removed after 0-9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because the minus sign is removed after 0-9

@NJ-2020 It does not look correct to remove the hyphen.

replacement: '<mention-report>$1</mention-report>',
},

Expand Down
Loading