Skip to content
Snippets Groups Projects
Verified Commit 8b33b1f0 authored by Loren Burkholder's avatar Loren Burkholder Committed by Nicolas Werner
Browse files

Simplify regex

parent 3748d785
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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 + " "
......
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment