bump: 3.5.2
This commit is contained in:
parent
aa6d2afce8
commit
be0230ebe9
3 changed files with 14 additions and 4 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
# 3.5.2/ 2017-04-05
|
||||||
|
|
||||||
|
* add optional current route param to toURL and use it to properly compose local anchor links
|
||||||
|
* fix code style by removing semicolons
|
||||||
|
* in toURL test for anchor links and if so prepend the currentPath to the generated path. fixes ([#142](https://github.com/QingWei-Li/docsify/issues/142))
|
||||||
|
|
||||||
# 3.5.1 / 2017-03-25
|
# 3.5.1 / 2017-03-25
|
||||||
|
|
||||||
* fix: .md file extension regex
|
* fix: .md file extension regex
|
||||||
|
|
|
||||||
|
|
@ -380,14 +380,18 @@ function parse (path) {
|
||||||
* to URL
|
* to URL
|
||||||
* @param {string} path
|
* @param {string} path
|
||||||
* @param {object} qs query params
|
* @param {object} qs query params
|
||||||
|
* @param {string} currentRoute optional current route
|
||||||
*/
|
*/
|
||||||
function toURL (path, params) {
|
function toURL (path, params, currentRoute) {
|
||||||
|
var local = currentRoute && path[0] === '#';
|
||||||
var route = parse(replaceSlug(path));
|
var route = parse(replaceSlug(path));
|
||||||
|
|
||||||
route.query = merge({}, route.query, params);
|
route.query = merge({}, route.query, params);
|
||||||
path = route.path + stringifyQuery(route.query);
|
path = route.path + stringifyQuery(route.query);
|
||||||
path = path.replace(/\.md(\?)|\.md$/, '$1');
|
path = path.replace(/\.md(\?)|\.md$/, '$1');
|
||||||
|
|
||||||
|
if (local) { path = currentRoute + path; }
|
||||||
|
|
||||||
return cleanPath('#/' + path)
|
return cleanPath('#/' + path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3025,7 +3029,7 @@ renderer.code = function (code, lang) {
|
||||||
renderer.link = function (href, title, text) {
|
renderer.link = function (href, title, text) {
|
||||||
var blank = '';
|
var blank = '';
|
||||||
if (!/:|(\/{2})/.test(href)) {
|
if (!/:|(\/{2})/.test(href)) {
|
||||||
href = toURL(href);
|
href = toURL(href, null, currentPath);
|
||||||
} else {
|
} else {
|
||||||
blank = ' target="_blank"';
|
blank = ' target="_blank"';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
lib/docsify.min.js
vendored
4
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue