Skip to content

Commit

Permalink
Fix dart-lang/markdown#578: list with checkbox mixed with empty lines (
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyeh authored Feb 20, 2024
1 parent 3cf910b commit 523cade
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/markdown/lib/src/block_syntaxes/list_syntax.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ abstract class ListSyntax extends BlockSyntax {
indent = precedingWhitespaces + contentWhitespances;
}

taskListItemState = null;
var content = contentBlockStart != null && !isBlank
? parseTaskListItem(textParser.substring(contentBlockStart))
: '';
Expand Down
16 changes: 16 additions & 0 deletions pkgs/markdown/test/extensions/ordered_list_with_checkboxes.unit
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 523cade

Please sign in to comment.