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

fix(NcRichContenteditable): respect forward slash as user mention character #5323

Merged
merged 1 commit into from Feb 28, 2024

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Feb 28, 2024

☑️ Resolves

  • During text parsing, user mentions wrapped with double quotes (@"user@nextcloud.com" or @"space user") handled differently from unwrapped.
  • There are cases mention could contain forward slash character (@"group/talk"), regex should respect that character correctly
  • Otherwise two following complex mention match groups treated as one

🖼️ Screenshots

🏚️ Before 🏡 After
Screenshot from 2024-02-28 17-47-22 Screenshot from 2024-02-28 17-48-15

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

…racter

- during parsing, user mentions wrapped with double quotes (@"user@nextcloud.com" or @"space user") handled differently from unwrapped. There are cases mention could contain forward slash character (@"group/talk"), regex should respect that character correctly

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy added bug Something isn't working 3. to review Waiting for reviews feature: rich-contenteditable Related to the rich-contenteditable components labels Feb 28, 2024
@Antreesy Antreesy added this to the 8.7.2 milestone Feb 28, 2024
@Antreesy Antreesy self-assigned this Feb 28, 2024
@Antreesy Antreesy requested a review from ShGKme February 28, 2024 17:12
@Antreesy
Copy link
Contributor Author

/backport to next

@Antreesy Antreesy merged commit 6f8f454 into master Feb 28, 2024
18 checks passed
@Antreesy Antreesy deleted the fix/noid/respect-forward-slash-in-mentions branch February 28, 2024 17:58
@@ -32,7 +32,7 @@ const MENTION_START = '(?:^|\\s)'
// Anything that is not text or end-of-line. Non-capturing group
const MENTION_END = '(?:[^a-z]|$)'
export const USERID_REGEX = new RegExp(`${MENTION_START}(@[a-zA-Z0-9_.@\\-']+)(${MENTION_END})`, 'gi')
export const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}(@&quot;[a-zA-Z0-9 _.@\\-']+&quot;)(${MENTION_END})`, 'gi')
export const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}(@&quot;[a-zA-Z0-9 _/.@\\-']+&quot;)(${MENTION_END})`, 'gi')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for federation we also need : as the port could be part of the cloudId

@Antreesy Antreesy mentioned this pull request Feb 29, 2024
@ShGKme ShGKme mentioned this pull request Feb 29, 2024
@ShGKme ShGKme modified the milestones: 8.7.2, 8.8.0 Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: rich-contenteditable Related to the rich-contenteditable components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants