From b8cf7dc5929331d3014555babc33bcda0dae4999 Mon Sep 17 00:00:00 2001 From: Hashim Khan <64767361+Hashim1999164@users.noreply.github.com> Date: Sat, 15 Aug 2026 23:57:45 +0500 Subject: [PATCH] fix: place task checkboxes after list loose is finalized (#4046) Loose nested task lists could leave checkboxes outside
because
checkbox placement used list.loose before spacer detection finished.
Compute the final loose state first, then place checkboxes.
Fixes #4045
---
src/Tokenizer.ts | 21 +++++++++++++--------
test/specs/new/list_loose_nested_tasks.html | 20 ++++++++++++++++++++
test/specs/new/list_loose_nested_tasks.md | 11 +++++++++++
3 files changed, 44 insertions(+), 8 deletions(-)
create mode 100644 test/specs/new/list_loose_nested_tasks.html
create mode 100644 test/specs/new/list_loose_nested_tasks.md
diff --git a/src/Tokenizer.ts b/src/Tokenizer.ts
index d4176e06..b6518498 100644
--- a/src/Tokenizer.ts
+++ b/src/Tokenizer.ts
@@ -416,9 +416,22 @@ export class _Tokenizer Prepare the project Run the tests Test lists Test tables
+
diff --git a/test/specs/new/list_loose_nested_tasks.md b/test/specs/new/list_loose_nested_tasks.md
new file mode 100644
index 00000000..aef580af
--- /dev/null
+++ b/test/specs/new/list_loose_nested_tasks.md
@@ -0,0 +1,11 @@
+* [ ] Prepare the project
+
+ * [ ] Install dependencies
+ * [x] Update Marked
+ * [ ] Check the rendering
+* [x] Run the tests
+
+ * [x] Test lists
+ * [ ] Test tables
+
+ * [ ] Test nested cases
+
+
+
+
+
+