fix(compiler): link

This commit is contained in:
qingwei.li 2017-02-18 22:13:03 +08:00 committed by cinwell.li
parent c108645e34
commit c7e09c34a7

View File

@ -67,7 +67,13 @@ renderer.code = function (code, lang = '') {
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
}
renderer.link = function (href, title, text) {
return `<a href="${toURL(href)}" title="${title || text}">${text}</a>`
let blank = ''
if (!/:|(\/{2})/.test(href)) {
href = toURL(href)
} else {
blank = ' target="_blank"'
}
return `<a href="${href}" title="${title || text}"${blank}>${text}</a>`
}
renderer.paragraph = function (text) {
if (/^!&gt;/.test(text)) {