From 5e1358d10d2cc102df6c9a12b52771c3b32d8aac Mon Sep 17 00:00:00 2001 From: boojack Date: Thu, 11 Dec 2025 07:52:23 +0800 Subject: [PATCH] revert changes Signed-off-by: boojack --- web/src/utils/markdown-manipulation.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/web/src/utils/markdown-manipulation.ts b/web/src/utils/markdown-manipulation.ts index e02dae474..6ae68719e 100644 --- a/web/src/utils/markdown-manipulation.ts +++ b/web/src/utils/markdown-manipulation.ts @@ -24,15 +24,7 @@ export function toggleTaskAtLine(markdown: string, lineNumber: number, checked: return lines.join("\n"); } -export function isInsideCodeBlock(lines :string [] , index : number):boolean{ - let inside = false; - for(let i = 0 ; i <= index ; i++){ - if(lines[i].startsWith("```")){ - inside = !inside; - } - } - return inside; -} + export function toggleTaskAtIndex(markdown: string, taskIndex: number, checked: boolean): string { const lines = markdown.split("\n"); const taskPattern = /^(\s*[-*+]\s+)\[([ xX])\](\s+.*)$/; @@ -40,7 +32,6 @@ export function toggleTaskAtIndex(markdown: string, taskIndex: number, checked: let currentTaskIndex = 0; for (let i = 0; i < lines.length; i++) { - if (isInsideCodeBlock(lines, i)) continue; const line = lines[i]; const match = line.match(taskPattern);