markdown links open in new tab

This commit is contained in:
Spectralitree 2021-02-06 17:03:26 +01:00
parent 53d97905fc
commit 967dfea182

View File

@ -152,7 +152,11 @@ const rules = {
return htmlTag('a', output(node.content, state), { class: 'd-spoiler' }, state);
}
},
link: markdown.defaultRules.link
link: Object.assign({ }, markdown.defaultRules.link, {
html: (node, output, state) => {
return htmlTag('a', output(node.content, state), { href: markdown.sanitizeUrl(node.target), rel: "noreferrer", target: "_blank" }, state);
}
})
};
const discordCallbackDefaults = {