From deab9e9faa4192450091a8e0addcf93d7137e538 Mon Sep 17 00:00:00 2001 From: Jason Gao Date: Tue, 12 Mar 2024 16:53:19 +0800 Subject: [PATCH] check if maxLines is `undefined` --- magicbook/plugins/codesplit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magicbook/plugins/codesplit.js b/magicbook/plugins/codesplit.js index eb3434d..2bca36b 100644 --- a/magicbook/plugins/codesplit.js +++ b/magicbook/plugins/codesplit.js @@ -51,7 +51,7 @@ Plugin.prototype = { (this.isComment(line) && pair.code.length > 0) || (!pair.maxLines && currentIndent < pair.indent) || (!pair.maxLines && line === '' && pair.comment.length > 0) || - (!!pair.maxLines && pair.code.length >= pair.maxLines) + (pair.maxLines !== undefined && pair.code.length >= pair.maxLines) ) { if (pair.code.length > 0 || pair.comment.length > 0) { pairs.push(pair);