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
|
|
@ -61,7 +61,11 @@ RoomsModel::data(const QModelIndex &index, int role) const
|
|||
if (UserSettings::instance()->markdown()) {
|
||||
QString percentEncoding = QUrl::toPercentEncoding(roomAliases[index.row()]);
|
||||
return QStringLiteral("[%1](https://matrix.to/#/%2)")
|
||||
.arg(roomAliases[index.row()], percentEncoding);
|
||||
.arg(QString(roomAliases[index.row()])
|
||||
.replace("[", "\\[")
|
||||
.replace("]", "\\]")
|
||||
.toHtmlEscaped(),
|
||||
percentEncoding);
|
||||
} else {
|
||||
return roomAliases[index.row()];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue