[build] 4.1.14

This commit is contained in:
qingwei.li 2017-06-24 20:52:21 +08:00
parent 4bde6d685c
commit f598e53098
No known key found for this signature in database
GPG Key ID: B6DDC2F7AE80B2F4
6 changed files with 21 additions and 15 deletions

View File

@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.1.13</small>
# docsify <small>4.1.14</small>
> A magical documentation site generator.

View File

@ -3318,7 +3318,7 @@ History.prototype.getBasePath = function getBasePath () {
return this.config.basePath
};
History.prototype.getFile = function getFile (path) {
History.prototype.getFile = function getFile (path, isRelative) {
path = path || this.getCurrentPath();
var ref = this;
@ -3330,6 +3330,10 @@ History.prototype.getFile = function getFile (path) {
path = path === '/README.md' ? (config.homepage || path) : path;
path = isAbsolutePath(path) ? path : getPath(base, path);
if (isRelative) {
path = path.replace(new RegExp(("^" + base)), '');
}
return path
};
@ -3423,7 +3427,7 @@ var HashHistory = (function (History$$1) {
return {
path: path,
file: this.getFile(path),
file: this.getFile(path, true),
query: parseQuery(query)
}
};
@ -3536,6 +3540,12 @@ function routerMixin (proto) {
var lastRoute = {};
function updateRender (vm) {
vm.router.normalize();
vm.route = vm.router.parse();
body.setAttribute('data-page', vm.route.file);
}
function initRouter (vm) {
var config = vm.config;
var mode = config.routerMode || 'hash';
@ -3548,13 +3558,11 @@ function initRouter (vm) {
}
vm.router = router;
router.normalize();
lastRoute = vm.route = router.parse();
updateRender(vm);
lastRoute = vm.route;
router.onchange(function (_) {
router.normalize();
vm.route = router.parse();
updateRender(vm);
vm._updateRender();
if (lastRoute.path === vm.route.path) {
@ -3750,7 +3758,7 @@ initGlobalAPI();
/**
* Version
*/
Docsify.version = '4.1.13';
Docsify.version = '4.1.14';
/**
* Run Docsify

4
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -87,8 +87,6 @@ function search (keywords) {
var postTitle = post.title && post.title.trim();
var postContent = post.body && post.body.trim();
var postUrl = post.slug || '';
postContent = postContent.replace(/!\[.*\]\((.+)\)/g,'');
if (postTitle && postContent) {
keywords.forEach(function (keyword, i) {

View File

@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.1.13",
"version": "4.1.14",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",

View File

@ -9,7 +9,7 @@ export function routerMixin (proto) {
let lastRoute = {}
function updateRender(vm) {
function updateRender (vm) {
vm.router.normalize()
vm.route = vm.router.parse()
dom.body.setAttribute('data-page', vm.route.file)