Skip to content

Commit

Permalink
fix(compiler): link
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 19, 2017
1 parent c108645 commit c7e09c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/render/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit c7e09c3

Please sign in to comment.