Fix matrix.to link escaping
Properly escapes in replies and with unmatched []. fixes #854
This commit is contained in:
parent
a5dafec147
commit
0ad74590d4
5 changed files with 59 additions and 12 deletions
|
|
@ -43,7 +43,10 @@ UsersModel::data(const QModelIndex &index, int role) const
|
|||
case CompletionModel::CompletionRole:
|
||||
if (UserSettings::instance()->markdown())
|
||||
return QStringLiteral("[%1](https://matrix.to/#/%2)")
|
||||
.arg(displayNames[index.row()].toHtmlEscaped(),
|
||||
.arg(QString(displayNames[index.row()])
|
||||
.replace("[", "\\[")
|
||||
.replace("]", "\\]")
|
||||
.toHtmlEscaped(),
|
||||
QString(QUrl::toPercentEncoding(userids[index.row()])));
|
||||
else
|
||||
return displayNames[index.row()];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue