fix: in renderInline after escaping html replace all newlines with `<br/>`
This commit is contained in:
parent
344880b3a3
commit
1ea4af17af
|
@ -1,4 +1,4 @@
|
||||||
import sequtils, re
|
import sequtils, re, strutils
|
||||||
|
|
||||||
let NEW_LINE = re"\n|\r"
|
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
|
# See render-inline in status-react/src/status_im/ui/screens/chat/message/message.cljs
|
||||||
proc renderInline(self: ChatMessageList, elem: TextItem): string =
|
proc renderInline(self: ChatMessageList, elem: TextItem): string =
|
||||||
let value = escape_html(elem.literal)
|
let value = escape_html(elem.literal).multiReplace(("\n", "<br/>"))
|
||||||
case elem.textType:
|
case elem.textType:
|
||||||
of "": result = value
|
of "": result = value
|
||||||
of "code": result = fmt("<code>{value}</code>")
|
of "code": result = fmt("<code>{value}</code>")
|
||||||
|
|
Loading…
Reference in New Issue