Recognize combining marks in formatted mentions

Split the existing PR change into a smaller reviewable piece.
Original change: fix(composer): accept combining marks in @mention regex
This commit is contained in:
Taksh committed 2026-10-05 16:10:52 +05:30
1 parent 5e9287fae1
commit f1b352ff6b
1 file changed
+3 -1
@@ -41,7 +41,9 @@ final class MessageFormattingEngine {
enum Patterns {
static let hashtag = SafeRegex.compile("#([a-zA-Z0-9_]+)")
static let mention = SafeRegex.compile("@([\\p{L}0-9_]+(?:#[a-fA-F0-9]{4})?)")
// Include \p{M} so NFD nicknames (base letter + combining mark) still
// parse as one mention token; NFC forms are covered by \p{L} alone.
static let mention = SafeRegex.compile("@([\\p{L}\\p{M}0-9_]+(?:#[a-fA-F0-9]{4})?)")
/// Trailing partial `@nickname` at the composer cursor — autocomplete only.
static let mentionAutocomplete = SafeRegex.compile("@([\\p{L}0-9_]*)$")