Fix inline image escape order

This commit is contained in:
Nicolas Werner 2022-08-18 22:05:47 +02:00
parent 08b304eccf
commit ff87bef030
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -600,6 +600,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
if (isReply) if (isReply)
formattedBody_ = formattedBody_.remove(replyFallback); formattedBody_ = formattedBody_.remove(replyFallback);
} }
formattedBody_ = utils::escapeBlacklistedHtml(formattedBody_);
// TODO(Nico): Don't parse html with a regex // TODO(Nico): Don't parse html with a regex
const static QRegularExpression matchIsImg(QStringLiteral("<img [^>]+>")); const static QRegularExpression matchIsImg(QStringLiteral("<img [^>]+>"));
@ -637,8 +638,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
formattedBody_.replace(curImg, imgReplacement); formattedBody_.replace(curImg, imgReplacement);
} }
return QVariant( return QVariant(utils::replaceEmoji(utils::linkifyMessage(formattedBody_)));
utils::replaceEmoji(utils::linkifyMessage(utils::escapeBlacklistedHtml(formattedBody_))));
} }
case Url: case Url:
return QVariant(QString::fromStdString(url(event))); return QVariant(QString::fromStdString(url(event)));