Fix newlines not being displayed (#122)

Fixes #64
This commit is contained in:
Benjamin Saunders 2017-11-05 14:29:02 -08:00 committed by mujx
parent d0d15f8f58
commit e19775443a
1 changed files with 5 additions and 1 deletions

View File

@ -92,6 +92,7 @@ TimelineItem::TimelineItem(events::MessageEventType ty,
}
body = body.toHtmlEscaped();
body.replace("\n", "<br/>");
body.replace(URL_REGEX, URL_HTML);
generateTimestamp(timestamp);
@ -197,7 +198,8 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Notice> &event,
" sent a notification",
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());
generateTimestamp(timestamp);
@ -244,6 +246,7 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Emote> &event,
generateTimestamp(timestamp);
emoteMsg = emoteMsg.toHtmlEscaped();
emoteMsg.replace("\n", "<br/>");
emoteMsg.replace(URL_REGEX, URL_HTML);
if (with_sender) {
@ -283,6 +286,7 @@ TimelineItem::TimelineItem(const events::MessageEvent<msgs::Text> &event,
generateTimestamp(timestamp);
body = body.toHtmlEscaped();
body.replace("\n", "<br/>");
body.replace(URL_REGEX, URL_HTML);
if (with_sender) {