Skip to content

Commit 8dd9160

Browse files
authored
Revert "Fix: ready/doneEach order with async afterEach (#1770)"
This reverts commit 076d084.
1 parent 9339382 commit 8dd9160

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/core/render/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ export function Render(Base) {
321321
);
322322
}
323323

324-
this.callHook('afterEach', html, hookData => {
325-
renderMain.call(this, hookData);
326-
next();
327-
});
324+
this.callHook('afterEach', html, hookData =>
325+
renderMain.call(this, hookData)
326+
);
328327
};
329328

330329
if (this.isHTML) {
331330
html = this.result = text;
332331
callback();
332+
next();
333333
} else {
334334
prerenderEmbed(
335335
{
@@ -339,6 +339,7 @@ export function Render(Base) {
339339
tokens => {
340340
html = this.compiler.compile(tokens);
341341
callback();
342+
next();
342343
}
343344
);
344345
}

test/e2e/plugins.test.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test.describe('Plugins', () => {
99
'mounted',
1010
'beforeEach-async',
1111
'beforeEach',
12-
'afterEach-async',
12+
// 'afterEach-async',
1313
'afterEach',
1414
'doneEach',
1515
'ready',
@@ -41,12 +41,13 @@ test.describe('Plugins', () => {
4141
return markdown;
4242
});
4343

44-
hook.afterEach(function (html, next) {
45-
setTimeout(function () {
46-
console.log('afterEach-async');
47-
next(html);
48-
}, 100);
49-
});
44+
// FIXME: https://github.com/docsifyjs/docsify/issues/449
45+
// hook.afterEach(function (html, next) {
46+
// setTimeout(function () {
47+
// console.log('afterEach-async');
48+
// next(html);
49+
// }, 100);
50+
// });
5051

5152
hook.afterEach(function (html) {
5253
console.log('afterEach');

0 commit comments

Comments
 (0)