diff --git a/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift b/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift index b935b871f..7f8c6dc8c 100644 --- a/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift +++ b/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift @@ -21,6 +21,9 @@ struct PlainMentionBuilder: MentionBuilderProtocol { func handleAllUsersMention(for attributedString: NSMutableAttributedString, in range: NSRange) { } func handleUserMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, userID: String) { + guard !attributedString.attributedSubstring(from: range).string.hasPrefix("@") else { + return + } attributedString.insert(NSAttributedString(string: "@"), at: range.location) } }