mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Properly handle html tags
This commit is contained in:
parent
1024198228
commit
ed5a96341b
1 changed files with 5 additions and 2 deletions
|
@ -90,6 +90,7 @@ TimelineItem::TimelineItem(events::MessageEventType ty,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body = body.toHtmlEscaped();
|
||||||
body.replace(URL_REGEX, URL_HTML);
|
body.replace(URL_REGEX, URL_HTML);
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
|
|
||||||
|
@ -230,7 +231,7 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Emote> &event,
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
||||||
auto body = event.content().body().trimmed().toHtmlEscaped();
|
auto body = event.content().body().trimmed();
|
||||||
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
||||||
auto displayName = TimelineViewManager::displayName(event.sender());
|
auto displayName = TimelineViewManager::displayName(event.sender());
|
||||||
auto emoteMsg = QString("* %1 %2").arg(displayName).arg(body);
|
auto emoteMsg = QString("* %1 %2").arg(displayName).arg(body);
|
||||||
|
@ -241,6 +242,7 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Emote> &event,
|
||||||
descriptiveTime(QDateTime::fromMSecsSinceEpoch(event.timestamp())) };
|
descriptiveTime(QDateTime::fromMSecsSinceEpoch(event.timestamp())) };
|
||||||
|
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
|
emoteMsg = emoteMsg.toHtmlEscaped();
|
||||||
emoteMsg.replace(URL_REGEX, URL_HTML);
|
emoteMsg.replace(URL_REGEX, URL_HTML);
|
||||||
|
|
||||||
if (with_sender) {
|
if (with_sender) {
|
||||||
|
@ -267,7 +269,7 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Text> &event,
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
|
||||||
auto body = event.content().body().trimmed().toHtmlEscaped();
|
auto body = event.content().body().trimmed();
|
||||||
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
||||||
auto displayName = TimelineViewManager::displayName(event.sender());
|
auto displayName = TimelineViewManager::displayName(event.sender());
|
||||||
|
|
||||||
|
@ -279,6 +281,7 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Text> &event,
|
||||||
|
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
|
|
||||||
|
body = body.toHtmlEscaped();
|
||||||
body.replace(URL_REGEX, URL_HTML);
|
body.replace(URL_REGEX, URL_HTML);
|
||||||
|
|
||||||
if (with_sender) {
|
if (with_sender) {
|
||||||
|
|
Loading…
Reference in a new issue