From 1ea4af17af428e6cccb60c237c33952bfb47f542 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Tue, 15 Dec 2020 11:45:09 -0600 Subject: [PATCH] fix: in renderInline after escaping html replace all newlines with `
` --- src/app/chat/views/message_format.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/chat/views/message_format.nim b/src/app/chat/views/message_format.nim index 3e8c23e9ff..92dedd0198 100644 --- a/src/app/chat/views/message_format.nim +++ b/src/app/chat/views/message_format.nim @@ -1,4 +1,4 @@ -import sequtils, re +import sequtils, re, strutils let NEW_LINE = re"\n|\r" @@ -17,7 +17,7 @@ proc mention(self: ChatMessageList, pubKey: string): string = # See render-inline in status-react/src/status_im/ui/screens/chat/message/message.cljs proc renderInline(self: ChatMessageList, elem: TextItem): string = - let value = escape_html(elem.literal) + let value = escape_html(elem.literal).multiReplace(("\n", "
")) case elem.textType: of "": result = value of "code": result = fmt("{value}")