diff --git a/core/chat/events/events.go b/core/chat/events/events.go index 18fdfee6b..241646ea3 100644 --- a/core/chat/events/events.go +++ b/core/chat/events/events.go @@ -95,7 +95,7 @@ func RenderAndSanitize(raw string) string { func RenderMarkdown(raw string) string { markdown := goldmark.New( goldmark.WithRendererOptions( - html.WithUnsafe(), + html.WithHardWraps(), ), goldmark.WithExtensions( extension.NewLinkify( diff --git a/utils/utils.go b/utils/utils.go index 73f79999b..c532f8b92 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -90,6 +90,7 @@ func RenderSimpleMarkdown(raw string) string { markdown := goldmark.New( goldmark.WithRendererOptions( html.WithUnsafe(), + html.WithHardWraps(), ), goldmark.WithExtensions( extension.NewLinkify( diff --git a/webroot/js/components/chat/chat-message-view.js b/webroot/js/components/chat/chat-message-view.js index 24e1bfc92..8ed79babd 100644 --- a/webroot/js/components/chat/chat-message-view.js +++ b/webroot/js/components/chat/chat-message-view.js @@ -183,7 +183,7 @@ function formatTimestamp(sentAt) { text into the `contenteditable` area on a page. */ function convertToMarkup(str = '') { - return convertToText(str).replace(/\n/g, '
'); + return str;// convertToText(str).replace(/\n/g, '
'); } function stripTags(str) { diff --git a/webroot/styles/chat.css b/webroot/styles/chat.css index 9b5138307..e14f92e6a 100644 --- a/webroot/styles/chat.css +++ b/webroot/styles/chat.css @@ -179,6 +179,19 @@ /* height: 15rem; */ } +.message-text ul li:before { + content: 'ยป '; +} + +.message-text p { + margin-bottom: 1.0em; +} + +.message-text li { + margin: 0.3em; + margin-bottom: 1.0em; +} + /* MESSAGE TEXT CONTENT */ /* MESSAGE TEXT CONTENT */ /* MESSAGE TEXT CONTENT */