Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c7e09c3

Browse filesBrowse files
committed
fix(compiler): link
1 parent c108645 commit c7e09c3
Copy full SHA for c7e09c3

1 file changed

+7-1Lines changed: 7 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/core/render/compiler.js‎

Copy file name to clipboardExpand all lines: src/core/render/compiler.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ renderer.code = function (code, lang = '') {
6767
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
6868
}
6969
renderer.link = function (href, title, text) {
70-
return `<a href="${toURL(href)}" title="${title || text}">${text}</a>`
70+
let blank = ''
71+
if (!/:|(\/{2})/.test(href)) {
72+
href = toURL(href)
73+
} else {
74+
blank = ' target="_blank"'
75+
}
76+
return `<a href="${href}" title="${title || text}"${blank}>${text}</a>`
7177
}
7278
renderer.paragraph = function (text) {
7379
if (/^!&gt;/.test(text)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.