summary refs log tree commit diff
path: root/src/UsersModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-05-31 18:17:35 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2024-05-31 18:28:16 +0200
commitec9af40fc50142f32924efd9235ca5912b6fe395 (patch)
treef81bba9db7cff61d5f967d7ded1fb192108de3e9 /src/UsersModel.cpp
parentDisable image loaded workaround for Qt 6.7 and up (diff)
downloadnheko-ec9af40fc50142f32924efd9235ca5912b6fe395.tar.xz
fix mentions with markdown and in edits
Diffstat (limited to '')
-rw-r--r--src/UsersModel.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/UsersModel.cpp b/src/UsersModel.cpp

index a017aa84..28f6c6fa 100644 --- a/src/UsersModel.cpp +++ b/src/UsersModel.cpp
@@ -11,6 +11,7 @@ #include "CompletionModelRoles.h" #include "Logging.h" #include "UserSettingsPage.h" +#include "Utils.h" UsersModel::UsersModel(const std::string &roomId, QObject *parent) : QAbstractListModel(parent) @@ -66,10 +67,7 @@ UsersModel::data(const QModelIndex &index, int role) const case CompletionModel::CompletionRole: if (UserSettings::instance()->markdown()) return QStringLiteral("[%1](https://matrix.to/#/%2)") - .arg(QString(displayNames[index.row()]) - .replace("[", "\\[") - .replace("]", "\\]") - .toHtmlEscaped(), + .arg(utils::escapeMentionMarkdown(QString(displayNames[index.row()])), QString(QUrl::toPercentEncoding(userids[index.row()]))); else return displayNames[index.row()];