-
Notifications
You must be signed in to change notification settings - Fork 136
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 the issue that inconsistent highlighting occurs when multiple mentions are used without spaces #594
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@aimane-chnaif can you comment here so I can assign you for review please? |
reviewing |
@@ -1298,6 +1298,36 @@ test('Test for @here mention without space or supported styling character', () = | |||
expect(parser.replace(testString)).toBe(resultString); | |||
}); | |||
|
|||
test('Test user mention and here mention, which are concatenated without space', () => { |
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.
please use general emails, not mine 😄
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.
It's updated with general ones
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.
Also update Step 2 in Tests as well
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.
done as well
@aimane-chnaif good catch of edge case |
@aimane-chnaif I fixed and added auto test cases, please check again |
@agilejune looks like you have some failing tests. |
@agilejune please merge main and fix javascript test failing |
@puneetlath @aimane-chnaif |
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.
What code change you done to fix js lint?
lib/ExpensiMark.js
Outdated
@@ -202,7 +208,7 @@ export default class ExpensiMark { | |||
return this.modifyTextForQuote(regex, textToProcess, replacement); | |||
}, | |||
replacement: (g1) => { | |||
const replacedText = this.replace(g1, {filterRules: ['heading1'], shouldEscapeText: false}); | |||
const replacedText = this.replace(g1, { filterRules: ['heading1'], shouldEscapeText: false }); |
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.
remove all irrelevant changes like this. Keep original code formatting
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.
oops, mistake of auto formatting
all restored
@aimane-chnaif
0c9f1f8
to
b5707f8
Compare
lib/str.js
Outdated
@@ -944,7 +944,8 @@ const Str = { | |||
*/ | |||
isValidMention(mention) { | |||
// Mentions can start @ proceeded by a space, eg "ping @[email protected]" | |||
if (/[\s@]/g.test(mention.charAt(0))) { | |||
// or by a @here, eg "@here@[email protected]" | |||
if (/[\s@]/g.test(mention.charAt(0)) || /^@here.*/g.test(mention)) { |
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.
Is this change needed? I don't see issue without adding this condition
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.
If this fixes something, add more test case affected by this change
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.
@aimane-chnaif you're right. it's needless
I removed it
@puneetlath Is this known bug? style broken on iOS native |
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.
LGTM 🎉
@puneetlath all yours
Sorry for the delay. Code looks good to me, but tests are failing. |
@puneetlath It's fixed |
Fixed Issues
$ Expensify/App#21753
Proposal: Expensify/App#21753 (comment)
Tests
QA
Same as tests step
Offline tests
Same as tests step
Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android