Skip to content

Commit

Permalink
Merge pull request #5976 from arthurlockman/bugfix/5589-invalid-regex…
Browse files Browse the repository at this point in the history
…-older-ios

fix(NcRichText): modify MENTION_START regex to work on older MobileSafari versions
  • Loading branch information
susnux authored Aug 20, 2024
2 parents 756d004 + 38d3afe commit 8b0065c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mixins/richEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import stripTags from 'striptags'
import Vue from 'vue'

// Referenced from public function getMentions(): https://github.com/nextcloud/server/blob/master/lib/private/Comments/Comment.php
// Beginning or whitespace. Non-capturing group within word boundary
const MENTION_START = /\B(?<![^a-z0-9_\-@.'\s])/.source
// Beginning or whitespace. Uses positive lookahead (to work on MobileSafari <16.4)
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 = /@&quot;guest\/[a-f0-9]+&quot;/.source
Expand Down

0 comments on commit 8b0065c

Please sign in to comment.