From b1a905edb120914bf370b3cca185bd89b10b1ec5 Mon Sep 17 00:00:00 2001
From: vamsi
Date: Thu, 26 Mar 2026 23:25:10 +0530
Subject: [PATCH] fix: correctly recognize GFM task list items with empty
content
---
src/rules.ts | 4 ++--
test/specs/new/list_loose_tasks.html | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/rules.ts b/src/rules.ts
index 4983a8ab48..7478556ffd 100644
--- a/src/rules.ts
+++ b/src/rules.ts
@@ -45,8 +45,8 @@ export const other = {
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
- listIsTask: /^\[[ xX]\] +\S/,
- listReplaceTask: /^\[[ xX]\] +/,
+ listIsTask: /^\[[ xX]\](?:\s|$)/,
+ listReplaceTask: /^\[[ xX]\][ \t]*/,
listTaskCheckbox: /\[[ xX]\]/,
anyLine: /\n.*\n/,
hrefBrackets: /^<(.*)>$/,
diff --git a/test/specs/new/list_loose_tasks.html b/test/specs/new/list_loose_tasks.html
index 1416f042ef..23e325eb9a 100644
--- a/test/specs/new/list_loose_tasks.html
+++ b/test/specs/new/list_loose_tasks.html
@@ -9,6 +9,6 @@
Task2
-[ ]
+