Skip to content

Commit

Permalink
Merge pull request #6237 from nextcloud-libraries/backport/6233/next
Browse files Browse the repository at this point in the history
[next] fix(NcRichContenteditable): support email mentions
  • Loading branch information
susnux authored Nov 19, 2024
2 parents 512f628 + 03e2de0 commit ed5f78d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit ed5f78d

Please sign in to comment.