From 64309beee91e961c53f1af5ed1eb3b1cf7dfd0b7 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Fri, 23 Dec 2016 01:20:28 +0800 Subject: [PATCH] Fixed render link --- .gitignore | 1 + CHANGELOG.md | 5 +++++ docs/_coverpage.md | 2 +- src/render.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 012dc25..a1ee562 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store *.log node_modules yarn.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 401fb06..b8be2e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.3.2 + +### Bug fixes +- Fixed render link + ## 1.3.1 ### Bug fixes diff --git a/docs/_coverpage.md b/docs/_coverpage.md index c26e673..08945c4 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 1.3.1 +# docsify 1.3.2 > A magical documentation site generator. diff --git a/src/render.js b/src/render.js index 08ea952..9872695 100644 --- a/src/render.js +++ b/src/render.js @@ -42,7 +42,7 @@ renderer.code = function (code, lang = '') { } renderer.link = function (href, title, text) { if (OPTIONS.router && !/^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/.test(href)) { - href = !/^\/#/.test(href) ? `#/${getRoute()}${href}` : href + href = `#/${href}`.replace(/\/\//g, '/') } return `${text}`