diff --git a/src/messageeventmodel.cpp b/src/messageeventmodel.cpp index 3ce3ed7c4..ffba3e569 100644 --- a/src/messageeventmodel.cpp +++ b/src/messageeventmodel.cpp @@ -267,7 +267,8 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const { const auto& evt = isPending ? **pendingIt : **timelineIt; if (role == Qt::DisplayRole) { - return utils::removeReply(m_currentRoom->eventToString(evt, Qt::RichText)); + return utils::cleanHTML( + utils::removeReply(m_currentRoom->eventToString(evt, Qt::RichText))); } if (role == MessageRole) { @@ -410,8 +411,8 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const { case ReplyEventIdRole: return replyEventId; case ReplyDisplayRole: - return utils::removeReply( - m_currentRoom->eventToString(replyEvt, Qt::RichText)); + return utils::cleanHTML(utils::removeReply( + m_currentRoom->eventToString(replyEvt, Qt::RichText))); case ReplyAuthorRole: return QVariant::fromValue(m_currentRoom->user(replyEvt.senderId())); } diff --git a/src/utils.cpp b/src/utils.cpp index 3154dd338..5571575eb 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -7,7 +7,7 @@ QString utils::removeReply(const QString& text) { return result; } -QString utils::cleanHTML(const QString& text, QMatrixClient::Room* room) { +QString utils::cleanHTML(const QString& text) { QString result(text); result.replace(codePillRegExp, "\\1"); result.replace(userPillRegExp, "\\1"); diff --git a/src/utils.h b/src/utils.h index dc366481d..81a1231bb 100644 --- a/src/utils.h +++ b/src/utils.h @@ -25,7 +25,7 @@ static const QRegularExpression userPillRegExp{ QRegularExpression::DotMatchesEverythingOption}; QString removeReply(const QString& text); -QString cleanHTML(const QString& text, QMatrixClient::Room* room); +QString cleanHTML(const QString& text); } // namespace utils #endif