diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index 92d27ba07..70e899115 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -67,7 +67,13 @@ renderer.code = function (code, lang = '') { return `
${hl}
` } renderer.link = function (href, title, text) { - return `${text}` + let blank = '' + if (!/:|(\/{2})/.test(href)) { + href = toURL(href) + } else { + blank = ' target="_blank"' + } + return `${text}` } renderer.paragraph = function (text) { if (/^!>/.test(text)) {