Skip to content

Commit 8418294

Browse files
committed
[build] 4.1.9
1 parent 56c7b9a commit 8418294

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
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.8</small>
3+
# docsify <small>4.1.9</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,22 @@ function initLifecycle (vm) {
126126
function callHook (vm, hook, data, next) {
127127
if ( next === void 0 ) next = noop;
128128

129-
var newData = data;
130129
var queue = vm._hooks[hook];
131130

132131
var step = function (index) {
133132
var hook = queue[index];
134133
if (index >= queue.length) {
135-
next(newData);
134+
next(data);
136135
} else {
137136
if (typeof hook === 'function') {
138137
if (hook.length === 2) {
139138
hook(data, function (result) {
140-
newData = result;
139+
data = result;
141140
step(index + 1);
142141
});
143142
} else {
144143
var result = hook(data);
145-
newData = result !== undefined ? result : newData;
144+
data = result !== undefined ? result : data;
146145
step(index + 1);
147146
}
148147
} else {
@@ -2797,8 +2796,8 @@ Compiler.prototype._initRenderer = function _initRenderer () {
27972796
var ref = this;
27982797
var linkTarget = ref.linkTarget;
27992798
var router = ref.router;
2800-
var toc = ref.toc;
28012799
var contentBase = ref.contentBase;
2800+
var _self = this;
28022801
/**
28032802
* render anchor tag
28042803
* @link https://github.com/chjj/marked#overriding-renderer-methods
@@ -2821,7 +2820,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
28212820
var slug = slugify(text);
28222821
var url = router.toURL(router.getCurrentPath(), { id: slug });
28232822
nextToc.slug = url;
2824-
toc.push(nextToc);
2823+
_self.toc.push(nextToc);
28252824

28262825
return ("<h" + level + " id=\"" + slug + "\"><a href=\"" + url + "\" data-id=\"" + slug + "\" class=\"anchor\"><span>" + text + "</span></a></h" + level + ">")
28272826
};
@@ -3288,6 +3287,7 @@ function initRender (vm) {
32883287
// Polyfll
32893288
cssVars(config.themeColor);
32903289
}
3290+
vm._updateRender();
32913291
toggleClass(body, 'ready');
32923292
}
32933293

@@ -3544,7 +3544,6 @@ function initRouter (vm) {
35443544

35453545
router.normalize();
35463546
lastRoute = vm.route = router.parse();
3547-
vm._updateRender();
35483547

35493548
router.onchange(function (_) {
35503549
router.normalize();

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/front-matter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,6 @@ var install = function (hook, vm) {
498498
});
499499
};
500500

501-
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
501+
$docsify.plugins = [].concat(install, $docsify.plugins);
502502

503503
}());

lib/plugins/front-matter.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)