From 523cadea3dc025e4fdc8fc7c3d0a85ae61619b75 Mon Sep 17 00:00:00 2001 From: Tom Yeh Date: Wed, 21 Feb 2024 01:30:29 +0800 Subject: [PATCH] Fix dart-lang/markdown#578: list with checkbox mixed with empty lines (dart-lang/markdown#583) --- .../lib/src/block_syntaxes/list_syntax.dart | 1 + .../extensions/ordered_list_with_checkboxes.unit | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/pkgs/markdown/lib/src/block_syntaxes/list_syntax.dart b/pkgs/markdown/lib/src/block_syntaxes/list_syntax.dart index c911ee701..d8711bb60 100644 --- a/pkgs/markdown/lib/src/block_syntaxes/list_syntax.dart +++ b/pkgs/markdown/lib/src/block_syntaxes/list_syntax.dart @@ -214,6 +214,7 @@ abstract class ListSyntax extends BlockSyntax { indent = precedingWhitespaces + contentWhitespances; } + taskListItemState = null; var content = contentBlockStart != null && !isBlank ? parseTaskListItem(textParser.substring(contentBlockStart)) : ''; diff --git a/pkgs/markdown/test/extensions/ordered_list_with_checkboxes.unit b/pkgs/markdown/test/extensions/ordered_list_with_checkboxes.unit index 3dce7b74e..8503e56e9 100644 --- a/pkgs/markdown/test/extensions/ordered_list_with_checkboxes.unit +++ b/pkgs/markdown/test/extensions/ordered_list_with_checkboxes.unit @@ -60,4 +60,20 @@
[ ] four
 
+ +>>> checkbox with empty content +1. [ ] one +2. +3. +4. four +5. [ ] five +6. +<<< +
    +
  1. one
  2. +
  3. +
  4. +
  5. four
  6. +
  7. five
  8. +
\ No newline at end of file