From 38ea660b78ede460e0760abbc6b2db3d5b0c2766 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sun, 12 Feb 2017 15:40:22 +0800 Subject: [PATCH] fix(render): render link --- src/render.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 `${text}`