From 1fce93378a509e254f85f8f35d53b0e774ff2baa Mon Sep 17 00:00:00 2001 From: frankthwang Date: Wed, 7 May 2025 12:18:35 +0800 Subject: [PATCH] fix regex parser --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 3c0e5fb..9acdd16 100644 --- a/main.js +++ b/main.js @@ -14,7 +14,7 @@ class TimerRenderer { .substr(11, 8); const colorStyle = timerData.Status === 'Running' ? 'style="color: #10b981;"' : ''; - return ` 【⏳${formatted} 】 `; + return `【⏳${formatted} 】 `; } } @@ -273,7 +273,7 @@ class TimerPlugin extends obsidian.Plugin { // Check for markdown checkbox or list patterns after indentation const afterIndent = lineText.slice(indentLen); - const checkboxMatch = /^([+\-*]\s\[[ x]\]|\s*[-+*]\s)/.exec(afterIndent); + const checkboxMatch = /^([+\-*]\s\[[^\]]\]\s+|\s*[-+*]\s+)/.exec(afterIndent); const checkboxLen = checkboxMatch ? checkboxMatch[1].length : 0; before = after = indentLen + checkboxLen;