-
Notifications
You must be signed in to change notification settings - Fork 132
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
base: main
Are you sure you want to change the base?
Conversation
@rojiphil Done |
lib/ExpensiMark.ts
Outdated
@@ -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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failling actually
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense.
Ah! So, we can ignore |
Sorry for the delay expensify-common/lib/ExpensiMark.ts Line 306 in e97172c
Just to make sure? |
yes. That's correct. Also, we should revert the change here as that's expected. |
Done |
@NJ-2020 The tests are failing. Did we break anything? Please check. |
Ah!, I know why we include the underscore inside the reportMentions regex, we include the underscore because we want to allow user to type italic room name expensify-common/__tests__/ExpensiMark-HTML-test.js Lines 2266 to 2269 in f11184e
expensify-common/__tests__/ExpensiMark-HTML-test.js Lines 2285 to 2287 in f11184e
As we can see the expected result if we put the underscore before and after the room name it should show in italic way i.e _#room_ should show #room
|
Ah that makes sense, let me investigate a little then I will get back to this. |
Fixed Issues
$ Expensify/App#46299
PROPOSAL: Expensify/App#46299 (comment)
Tests
#user1-#user2
QA
Details
Tests
#user1-#user2
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop