Skip to content

Commit

Permalink
test(toc_helper): use classic for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Nov 22, 2019
1 parent 7a4f797 commit 641dfd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/plugins/helper/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function tocHelper(str, options = {}) {
return id || (parent.length < 1 ? null : getId(parent));
}

for (const el of headings) {
const headingLen = headings.length;
for (let i = 0; i < headingLen; i++) {
const el = headings[i];
const level = +el.name[1];
const id = getId(el);
const text = escapeHTML(DomUtils.getText(el));
Expand Down

0 comments on commit 641dfd9

Please sign in to comment.