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