mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
Fix: ready/doneEach order with async afterEach (#1770)
This commit is contained in:
parent
63b2535a45
commit
32c6b3804e
@ -321,15 +321,15 @@ export function Render(Base) {
|
||||
);
|
||||
}
|
||||
|
||||
this.callHook('afterEach', html, hookData =>
|
||||
renderMain.call(this, hookData)
|
||||
);
|
||||
this.callHook('afterEach', html, hookData => {
|
||||
renderMain.call(this, hookData);
|
||||
next();
|
||||
});
|
||||
};
|
||||
|
||||
if (this.isHTML) {
|
||||
html = this.result = text;
|
||||
callback();
|
||||
next();
|
||||
} else {
|
||||
prerenderEmbed(
|
||||
{
|
||||
@ -339,7 +339,6 @@ export function Render(Base) {
|
||||
tokens => {
|
||||
html = this.compiler.compile(tokens);
|
||||
callback();
|
||||
next();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ test.describe('Plugins', () => {
|
||||
'mounted',
|
||||
'beforeEach-async',
|
||||
'beforeEach',
|
||||
// 'afterEach-async',
|
||||
'afterEach-async',
|
||||
'afterEach',
|
||||
'doneEach',
|
||||
'ready',
|
||||
@ -41,13 +41,12 @@ test.describe('Plugins', () => {
|
||||
return markdown;
|
||||
});
|
||||
|
||||
// FIXME: https://github.com/docsifyjs/docsify/issues/449
|
||||
// hook.afterEach(function (html, next) {
|
||||
// setTimeout(function () {
|
||||
// console.log('afterEach-async');
|
||||
// next(html);
|
||||
// }, 100);
|
||||
// });
|
||||
hook.afterEach(function (html, next) {
|
||||
setTimeout(function () {
|
||||
console.log('afterEach-async');
|
||||
next(html);
|
||||
}, 100);
|
||||
});
|
||||
|
||||
hook.afterEach(function (html) {
|
||||
console.log('afterEach');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user