mirror of
https://github.com/mattermost/focalboard.git
synced 2024-11-27 08:31:20 +02:00
Make Markdown urls open in _blank
This commit is contained in:
parent
3dfeeeba6d
commit
3f35d615c0
@ -47,7 +47,9 @@ class Utils {
|
||||
|
||||
static htmlFromMarkdown(text: string): string {
|
||||
// HACKHACK: Somehow, marked doesn't encode angle brackets
|
||||
const html = marked(text.replace(/</g, '<'))
|
||||
const renderer = new marked.Renderer()
|
||||
renderer.link = ( href, title, text ) => `<a target="_blank" href="${ href }" title="${ title || '' }">${ text }</a>`
|
||||
const html = marked(text.replace(/</g, '<'), { renderer })
|
||||
return html
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user