Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit d735b0b

Browse files
authored
Fix #578: list with checkbox mixed with empty lines (#583)
1 parent 6efe141 commit d735b0b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/src/block_syntaxes/list_syntax.dart

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ abstract class ListSyntax extends BlockSyntax {
214214
indent = precedingWhitespaces + contentWhitespances;
215215
}
216216

217+
taskListItemState = null;
217218
var content = contentBlockStart != null && !isBlank
218219
? parseTaskListItem(textParser.substring(contentBlockStart))
219220
: '';

test/extensions/ordered_list_with_checkboxes.unit

+16
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,20 @@
6060
<pre><code>[ ] four
6161
</code></pre>
6262
</li>
63+
</ol>
64+
>>> checkbox with empty content
65+
1. [ ] one
66+
2.
67+
3.
68+
4. four
69+
5. [ ] five
70+
6.
71+
<<<
72+
<ol class="contains-task-list">
73+
<li class="task-list-item"><input type="checkbox"></input>one</li>
74+
<li></li>
75+
<li></li>
76+
<li>four</li>
77+
<li class="task-list-item"><input type="checkbox"></input>five</li>
78+
<li></li>
6379
</ol>

0 commit comments

Comments
 (0)