Make mentions clickable

This commit is contained in:
Saoud Rizwan
2024-09-18 14:10:37 -04:00
parent c8050e603d
commit 593b3d6b7c
9 changed files with 55 additions and 18 deletions

View File

@@ -1,12 +1,4 @@
/*
Mention regex
- File and folder paths (starting with '/')
- URLs (containing '://')
- The 'problems' keyword
- Word boundary after 'problems' to avoid partial matches
*/
export const mentionRegex = /@((?:\/|\w+:\/\/)[^\s]+|problems\b)/
export const mentionRegexGlobal = new RegExp(mentionRegex.source, "g")
import { mentionRegex } from "../../../src/shared/context-mentions"
export function insertMention(text: string, position: number, value: string): string {
const beforeCursor = text.slice(0, position)