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

Fix #578: list with checkbox mixed with empty lines #583

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #578: list with checkbox mixed with empty lines
tomyeh committed Feb 20, 2024
commit 4a098ddf821e0eb7246760b710bd52d79a9ef1aa
1 change: 1 addition & 0 deletions lib/src/block_syntaxes/list_syntax.dart
Original file line number Diff line number Diff line change
@@ -214,6 +214,7 @@ abstract class ListSyntax extends BlockSyntax {
indent = precedingWhitespaces + contentWhitespances;
}

taskListItemState = null;
var content = contentBlockStart != null && !isBlank
? parseTaskListItem(textParser.substring(contentBlockStart))
: '';
16 changes: 16 additions & 0 deletions test/extensions/ordered_list_with_checkboxes.unit
Original file line number Diff line number Diff line change
@@ -60,4 +60,20 @@
<pre><code>[ ] four
</code></pre>
</li>
</ol>
>>> checkbox with empty content
1. [ ] one
2.
3.
4. four
5. [ ] five
6.
<<<
<ol class="contains-task-list">
<li class="task-list-item"><input type="checkbox"></input>one</li>
<li></li>
<li></li>
<li>four</li>
<li class="task-list-item"><input type="checkbox"></input>five</li>
<li></li>
</ol>