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