-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(message-parser): User mention with @ character (#894)
* Fix user mention with email pattern and add tests * adding languages support to mention and channel parser Co-authored-by: gabriellsh <[email protected]>
- Loading branch information
1 parent
25419be
commit aa9bc06
Showing
2 changed files
with
24 additions
and
3 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
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 |
---|---|---|
|
@@ -13,6 +13,22 @@ test.each([ | |
'@marcos.defendi:matrix.org', | ||
[paragraph([mentionUser('marcos.defendi:matrix.org')])], | ||
], | ||
['@[email protected]', [paragraph([mentionUser('[email protected]')])]], | ||
[ | ||
'@[email protected]', | ||
[paragraph([mentionUser('[email protected]')])], | ||
], | ||
['@téstãçâò', [paragraph([mentionUser('téstãçâò')])]], | ||
['@สมชาย', [paragraph([mentionUser('สมชาย')])]], | ||
['@李祖阳', [paragraph([mentionUser('李祖阳')])]], | ||
['@あおい', [paragraph([mentionUser('あおい')])]], | ||
['@アオイ', [paragraph([mentionUser('アオイ')])]], | ||
['@Владимир', [paragraph([mentionUser('Владимир')])]], | ||
['@Кириллица', [paragraph([mentionUser('Кириллица')])]], | ||
[ | ||
'test @Кириллица test', | ||
[paragraph([plain('test '), mentionUser('Кириллица'), plain(' test')])], | ||
], | ||
])('parses %p', (input, output) => { | ||
expect(parse(input)).toMatchObject(output); | ||
}); |