Stop propagation on markdown url click
This commit is contained in:
parent
3f35d615c0
commit
fe881b001d
1 changed files with 2 additions and 2 deletions
|
@ -48,8 +48,8 @@ class Utils {
|
|||
static htmlFromMarkdown(text: string): string {
|
||||
// HACKHACK: Somehow, marked doesn't encode angle brackets
|
||||
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 })
|
||||
renderer.link = (href, title, contents) => `<a target="_blank" href="${href}" title="${title || ''}" onclick="event.stopPropagation();">${contents}</a>`
|
||||
const html = marked(text.replace(/</g, '<'), {renderer})
|
||||
return html
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue