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

Commit c5fc0e4

Browse files
committed
Fix #578: check list mixed with empty content
1 parent a8288ca commit c5fc0e4

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/src/block_syntaxes/list_syntax.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ abstract class ListSyntax extends BlockSyntax {
141141

142142
final indentedLine = parser.current.content.dedent(indent);
143143

144+
taskListItemState = null;
144145
childLines.add(Line(
145146
blankLines == null
146147
? indentedLine.text
@@ -214,6 +215,7 @@ abstract class ListSyntax extends BlockSyntax {
214215
indent = precedingWhitespaces + contentWhitespances;
215216
}
216217

218+
taskListItemState = null;
217219
var content = contentBlockStart != null && !isBlank
218220
? parseTaskListItem(textParser.substring(contentBlockStart))
219221
: '';

test/extensions/ordered_list_with_checkboxes.unit

Lines changed: 16 additions & 0 deletions
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)