diff --git a/lib/core/checklist.dart b/lib/core/checklist.dart index 9d655b87..79143b1f 100644 --- a/lib/core/checklist.dart +++ b/lib/core/checklist.dart @@ -43,7 +43,7 @@ class ChecklistItem { class Checklist { static final _pattern = RegExp( - r'^(.*)- \[([ xX])\] +(.*)$', + r'^(.*)- \[([ xX])\] ?(.*)$', multiLine: false, ); diff --git a/test/checklist_test.dart b/test/checklist_test.dart index 31bedea0..429c170d 100644 --- a/test/checklist_test.dart +++ b/test/checklist_test.dart @@ -186,11 +186,11 @@ Booga Wooga var checklist = Checklist(note); note = checklist.note; - expect(note.body, "Hi.\n- [ ] One\n- Two\n- [ ] \n- [ ] "); + expect(note.body, "Hi.\n- [ ] One\n- Two\n- [ ] \n- [ ] "); }); test('Does not add extra new line', () async { - var content = "- [ ] One\n- [ ]Two\n- [ ] Three\n- [ ] Four\n"; + var content = "- [ ] One\n- [ ]Two\n- [ ] Three\n- [ ]Four\n"; var notePath = p.join(tempDir.path, "note449.md"); await File(notePath).writeAsString(content); @@ -204,11 +204,11 @@ Booga Wooga note = checklist.note; expect(note.body, - "- [ ] One\n- [ ]Two\n- [ ] Three\n- [ ] Four\n- [ ] Five\n"); + "- [ ] One\n- [ ] Two\n- [ ] Three\n- [ ] Four\n- [ ] Five\n"); }); test('Maintain x case', () async { - var content = "- [X] One\n- [ ]Two"; + var content = "- [X] One\n- [ ] Two"; var notePath = p.join(tempDir.path, "note448.md"); await File(notePath).writeAsString(content);