Skip to content

Commit 38ea660

Browse files
committed
fix(render): render link
1 parent 9e81a59 commit 38ea660

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/render.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function init () {
4343
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
4444
}
4545
renderer.link = function (href, title, text) {
46-
if (!/:/.test(href)) {
46+
if (!/[:|\/+]/.test(href)) {
4747
href = `#/${href}`.replace(/\/+/g, '/')
4848
}
4949

@@ -58,7 +58,7 @@ export function init () {
5858
return `<p>${text}</p>`
5959
}
6060
renderer.image = function (href, title, text) {
61-
const url = /:/.test(href) ? href : ($docsify.basePath + href).replace(/\/+/g, '/')
61+
const url = /[:|\/+]/.test(href) ? href : ($docsify.basePath + href).replace(/\/+/g, '/')
6262
const titleHTML = title ? ` title="${title}"` : ''
6363

6464
return `<img src="${url}" alt="${text}"${titleHTML} />`

0 commit comments

Comments
 (0)