Simplify regex
This commit is contained in:
parent
3748d7853e
commit
8b33b1f08b
@ -234,7 +234,7 @@ NotificationsManager::formatNotification(const mtx::responses::Notification ¬
|
||||
|
||||
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 ¬
|
||||
|
||||
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 ¬
|
||||
|
||||
return QTextDocumentFragment::fromHtml(
|
||||
mtx::accessors::formattedBodyWithFallback(notification.event)
|
||||
.replace(QRegularExpression("(<mx-reply>.+\\<\\/mx-reply\\>)"), ""))
|
||||
.replace(QRegularExpression("<mx-reply>.+</mx-reply>"), ""))
|
||||
.toPlainText()
|
||||
.prepend(messageLeadIn);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user