-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #594 from agilejune/fix-#21753
fix the issue that inconsistent highlighting occurs when multiple mentions are used without spaces
- Loading branch information
Showing
2 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1312,6 +1312,52 @@ 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', () => { | ||
let testString = '@[email protected]@here'; | ||
let resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected][email protected]'; | ||
resultString = '<mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@[email protected]'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@here@[email protected]'; | ||
resultString = '<mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@here'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@here@[email protected]'; | ||
resultString = '<mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@here'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@here@[email protected]'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@here@[email protected]'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@here@[email protected]'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
|
||
testString = '@[email protected]@here@here@[email protected]@here@[email protected]'; | ||
resultString = '<mention-user>@[email protected]</mention-user><mention-here>@here</mention-here><mention-here>@here</mention-here><mention-user>@[email protected]</mention-user><mention-here>@here</mention-here><mention-user>@[email protected]</mention-user>'; | ||
expect(parser.replace(testString)).toBe(resultString); | ||
}); | ||
|
||
test('Test for mention inside link and email markdown', () => { | ||
const testString = '[@[email protected]](expensify.com) ' | ||
+ '[_@[email protected]_](expensify.com) ' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters