Skip to content

Commit

Permalink
perf: skip evaluation if max_items is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
KentarouTakeda committed May 26, 2024
1 parent f00bf65 commit c17db64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/helper/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function getAndTruncateTocObj(str: string, options: {min_depth: number, max_dept
if (data.length === 0) {
return data;
}
if (max_items < 1) {
if (max_items < 1 || max_items === Infinity) {
return data;
}

Expand Down

0 comments on commit c17db64

Please sign in to comment.