Skip to content

Commit f598e53

Browse files
committed
[build] 4.1.14
1 parent 4bde6d6 commit f598e53

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/icon.svg)
22

3-
# docsify <small>4.1.13</small>
3+
# docsify <small>4.1.14</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,7 +3318,7 @@ History.prototype.getBasePath = function getBasePath () {
33183318
return this.config.basePath
33193319
};
33203320

3321-
History.prototype.getFile = function getFile (path) {
3321+
History.prototype.getFile = function getFile (path, isRelative) {
33223322
path = path || this.getCurrentPath();
33233323

33243324
var ref = this;
@@ -3330,6 +3330,10 @@ History.prototype.getFile = function getFile (path) {
33303330
path = path === '/README.md' ? (config.homepage || path) : path;
33313331
path = isAbsolutePath(path) ? path : getPath(base, path);
33323332

3333+
if (isRelative) {
3334+
path = path.replace(new RegExp(("^" + base)), '');
3335+
}
3336+
33333337
return path
33343338
};
33353339

@@ -3423,7 +3427,7 @@ var HashHistory = (function (History$$1) {
34233427

34243428
return {
34253429
path: path,
3426-
file: this.getFile(path),
3430+
file: this.getFile(path, true),
34273431
query: parseQuery(query)
34283432
}
34293433
};
@@ -3536,6 +3540,12 @@ function routerMixin (proto) {
35363540

35373541
var lastRoute = {};
35383542

3543+
function updateRender (vm) {
3544+
vm.router.normalize();
3545+
vm.route = vm.router.parse();
3546+
body.setAttribute('data-page', vm.route.file);
3547+
}
3548+
35393549
function initRouter (vm) {
35403550
var config = vm.config;
35413551
var mode = config.routerMode || 'hash';
@@ -3548,13 +3558,11 @@ function initRouter (vm) {
35483558
}
35493559

35503560
vm.router = router;
3551-
3552-
router.normalize();
3553-
lastRoute = vm.route = router.parse();
3561+
updateRender(vm);
3562+
lastRoute = vm.route;
35543563

35553564
router.onchange(function (_) {
3556-
router.normalize();
3557-
vm.route = router.parse();
3565+
updateRender(vm);
35583566
vm._updateRender();
35593567

35603568
if (lastRoute.path === vm.route.path) {
@@ -3750,7 +3758,7 @@ initGlobalAPI();
37503758
/**
37513759
* Version
37523760
*/
3753-
Docsify.version = '4.1.13';
3761+
Docsify.version = '4.1.14';
37543762

37553763
/**
37563764
* Run Docsify

lib/docsify.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/plugins/search.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ function search (keywords) {
8787
var postTitle = post.title && post.title.trim();
8888
var postContent = post.body && post.body.trim();
8989
var postUrl = post.slug || '';
90-
91-
postContent = postContent.replace(/!\[.*\]\((.+)\)/g,'');
9290

9391
if (postTitle && postContent) {
9492
keywords.forEach(function (keyword, i) {

packages/docsify-server-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsify-server-renderer",
3-
"version": "4.1.13",
3+
"version": "4.1.14",
44
"description": "docsify server renderer",
55
"author": {
66
"name": "qingwei-li",

src/core/router/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function routerMixin (proto) {
99

1010
let lastRoute = {}
1111

12-
function updateRender(vm) {
12+
function updateRender (vm) {
1313
vm.router.normalize()
1414
vm.route = vm.router.parse()
1515
dom.body.setAttribute('data-page', vm.route.file)

0 commit comments

Comments
 (0)