remove @ if not needed (#2126)

This commit is contained in:
Mauro
2023-11-21 11:02:23 +01:00
committed by GitHub
parent c6a6a4b127
commit 305aff20bd

View File

@@ -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)
}
}