diff --git a/src/render.js b/src/render.js index bc08ec960..e9d3e8632 100644 --- a/src/render.js +++ b/src/render.js @@ -43,7 +43,7 @@ export function init () { return `
${hl}
`
}
renderer.link = function (href, title, text) {
- if (!/:/.test(href)) {
+ if (!/[:|\/+]/.test(href)) {
href = `#/${href}`.replace(/\/+/g, '/')
}
@@ -58,7 +58,7 @@ export function init () {
return `${text}
` } renderer.image = function (href, title, text) { - const url = /:/.test(href) ? href : ($docsify.basePath + href).replace(/\/+/g, '/') + const url = /[:|\/+]/.test(href) ? href : ($docsify.basePath + href).replace(/\/+/g, '/') const titleHTML = title ? ` title="${title}"` : '' return ``