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

[next] fix(NcRichContenteditable): support email mentions #6237

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 src/mixins/richEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createApp } from 'vue'
const MENTION_START = /(?=[a-z0-9_\-@.'])\B/.source
// Capturing groups like: @user-id, @"guest/abc16def", @"federated_user/user-id", @"user-id with space"
const MENTION_SIMPLE = /(@[a-z0-9_\-@.']+)/.source
const MENTION_GUEST = /@"guest\/[a-f0-9]+"/.source
const MENTION_GUEST = /@"(?:guest|email){1}\/[a-f0-9]+"/.source
const MENTION_PREFIXED = /@"(?:federated_)?(?:group|team|user){1}\/[a-z0-9_\-@.' /:]+"/.source
const MENTION_WITH_SPACE = /@"[a-z0-9_\-@.' ]+"/.source
const MENTION_COMPLEX = `(${MENTION_GUEST}|${MENTION_PREFIXED}|${MENTION_WITH_SPACE})`
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/mixins/richEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ describe('richEditor.js', () => {
'hello foo@bar - hello @@foobar',
'@foobar no space - \n\n@foobar @foobar',
'hello @"guest/47e0a7cf"',
'hello @"email/47e0a7cf"',
'hello @"group/group-id" @"federated_user/user-id"',
'hello @"federated_user/[email protected]:8080"',
]
Expand All @@ -86,6 +87,7 @@ describe('richEditor.js', () => {
'hello foo@bar - hello @@foobar',
'@foobar no space - <br><br>@foobar @foobar',
'hello @"guest/47e0a7cf"',
'hello @"email/47e0a7cf"',
'hello @"group/group-id" @"federated_user/user-id"',
'hello @"federated_user/[email protected]:8080"',
]
Expand Down
Loading