1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-30 14:00:07 +02:00

Preserve line breaks in markdown

This commit is contained in:
Chen-I Lim 2020-11-18 11:01:07 -08:00
parent 998cb36421
commit 4f84ecb741

View File

@ -49,7 +49,7 @@ class Utils {
// HACKHACK: Somehow, marked doesn't encode angle brackets
const renderer = new marked.Renderer()
renderer.link = (href, title, contents) => `<a target="_blank" href="${href}" title="${title || ''}" onclick="event.stopPropagation();">${contents}</a>`
const html = marked(text.replace(/</g, '&lt;'), {renderer})
const html = marked(text.replace(/</g, '&lt;'), {renderer, breaks: true})
return html
}