Simplify regex

This commit is contained in:
Loren Burkholder 2021-02-26 15:38:46 -05:00 committed by Nicolas Werner
parent 3748d7853e
commit 8b33b1f08b
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
3 changed files with 3 additions and 3 deletions

View File

@ -234,7 +234,7 @@ NotificationsManager::formatNotification(const mtx::responses::Notification &not
return QTextDocumentFragment::fromHtml(
mtx::accessors::formattedBodyWithFallback(notification.event)
.replace(QRegularExpression("(<mx-reply>.+\\<\\/mx-reply\\>)"), ""))
.replace(QRegularExpression("<mx-reply>.+</mx-reply>"), ""))
.toPlainText()
.prepend(messageLeadIn);
}

View File

@ -20,7 +20,7 @@ NotificationsManager::formatNotification(const mtx::responses::Notification &not
return QTextDocumentFragment::fromHtml(
mtx::accessors::formattedBodyWithFallback(notification.event)
.replace(QRegularExpression("(<mx-reply>.+\\<\\/mx-reply\\>)"), ""))
.replace(QRegularExpression("<mx-reply>.+</mx-reply>"), ""))
.toPlainText()
.prepend((mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote)
? "* " + sender + " "

View File

@ -121,7 +121,7 @@ NotificationsManager::formatNotification(const mtx::responses::Notification &not
return QTextDocumentFragment::fromHtml(
mtx::accessors::formattedBodyWithFallback(notification.event)
.replace(QRegularExpression("(<mx-reply>.+\\<\\/mx-reply\\>)"), ""))
.replace(QRegularExpression("<mx-reply>.+</mx-reply>"), ""))
.toPlainText()
.prepend(messageLeadIn);
}