mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Fix wacky newline/linkification interaction
This commit is contained in:
parent
1a3bacd96e
commit
097dac4f79
1 changed files with 4 additions and 4 deletions
|
@ -92,8 +92,8 @@ TimelineItem::TimelineItem(events::MessageEventType ty,
|
||||||
}
|
}
|
||||||
|
|
||||||
body = body.toHtmlEscaped();
|
body = body.toHtmlEscaped();
|
||||||
body.replace("\n", "<br/>");
|
|
||||||
body.replace(URL_REGEX, URL_HTML);
|
body.replace(URL_REGEX, URL_HTML);
|
||||||
|
body.replace("\n", "<br/>");
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
|
|
||||||
if (withSender) {
|
if (withSender) {
|
||||||
|
@ -199,12 +199,12 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Notice> &event,
|
||||||
descriptiveTime(QDateTime::fromMSecsSinceEpoch(event.timestamp()))};
|
descriptiveTime(QDateTime::fromMSecsSinceEpoch(event.timestamp()))};
|
||||||
|
|
||||||
auto body = event.content().body().trimmed().toHtmlEscaped();
|
auto body = event.content().body().trimmed().toHtmlEscaped();
|
||||||
body.replace("\n", "<br/>");
|
|
||||||
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
auto timestamp = QDateTime::fromMSecsSinceEpoch(event.timestamp());
|
||||||
|
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
|
|
||||||
body.replace(URL_REGEX, URL_HTML);
|
body.replace(URL_REGEX, URL_HTML);
|
||||||
|
body.replace("\n", "<br/>");
|
||||||
body = "<i style=\"color: #565E5E\">" + body + "</i>";
|
body = "<i style=\"color: #565E5E\">" + body + "</i>";
|
||||||
|
|
||||||
if (with_sender) {
|
if (with_sender) {
|
||||||
|
@ -246,8 +246,8 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Emote> &event,
|
||||||
|
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
emoteMsg = emoteMsg.toHtmlEscaped();
|
emoteMsg = emoteMsg.toHtmlEscaped();
|
||||||
emoteMsg.replace("\n", "<br/>");
|
|
||||||
emoteMsg.replace(URL_REGEX, URL_HTML);
|
emoteMsg.replace(URL_REGEX, URL_HTML);
|
||||||
|
emoteMsg.replace("\n", "<br/>");
|
||||||
|
|
||||||
if (with_sender) {
|
if (with_sender) {
|
||||||
generateBody(displayName, emoteMsg);
|
generateBody(displayName, emoteMsg);
|
||||||
|
@ -286,8 +286,8 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Text> &event,
|
||||||
generateTimestamp(timestamp);
|
generateTimestamp(timestamp);
|
||||||
|
|
||||||
body = body.toHtmlEscaped();
|
body = body.toHtmlEscaped();
|
||||||
body.replace("\n", "<br/>");
|
|
||||||
body.replace(URL_REGEX, URL_HTML);
|
body.replace(URL_REGEX, URL_HTML);
|
||||||
|
body.replace("\n", "<br/>");
|
||||||
|
|
||||||
if (with_sender) {
|
if (with_sender) {
|
||||||
generateBody(displayName, body);
|
generateBody(displayName, body);
|
||||||
|
|
Loading…
Reference in a new issue