mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-29 08:29:22 +00:00
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:
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_]*)$")
|
||||
|
||||
Reference in new issue
Block a user