fix: Cannot read property level of undefined (#1357)

Co-authored-by: Anix <anik220798@gmail.com>
This commit is contained in:
沈唁 2020-09-01 17:34:27 +08:00 committed by GitHub
parent f35bf99d9c
commit 4807e58cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,7 +279,7 @@ export class Compiler {
// Remove headers who are under current header
for (
let j = i;
deletedHeaderLevel < toc[j].level && j < toc.length;
j < toc.length && deletedHeaderLevel < toc[j].level;
j++
) {
toc.splice(j, 1) && j-- && i++;