Avoid passing the whole unsafe display name to the rich text editor for generating mention pill permalinks

This commit is contained in:
Stefan Ceriu
2024-06-14 17:23:53 +03:00
committed by Stefan Ceriu
parent 2dccfff3e8
commit 0967bb43b4
@@ -431,7 +431,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
}
if context.composerFormattingEnabled {
wysiwygViewModel.setMention(url: url.absoluteString, name: item.displayName ?? item.id, mentionType: .user)
wysiwygViewModel.setMention(url: url.absoluteString, name: item.id, mentionType: .user)
} else {
let attributedString = NSMutableAttributedString(attributedString: state.bindings.plainComposerText)
mentionBuilder.handleUserMention(for: attributedString, in: suggestion.range, url: url, userID: item.id, userDisplayName: item.displayName)