Checklist: Avoid extra \n

The markdown parser is weird.
This commit is contained in:
Vishesh Handa
2020-04-02 17:56:48 +02:00
parent 28ef551805
commit 26f641380d
2 changed files with 51 additions and 0 deletions

View File

@ -205,5 +205,26 @@ Booga Wooga
note = checklist.note;
expect(note.body, "Hi.\n[ ] One\nTwo\n");
});
test('Does not add extra new line', () async {
var content = "[ ] One\n[ ]Two\n[ ] Three\n[ ] Four\n";
var notePath = p.join(tempDir.path, "note449.md");
await File(notePath).writeAsString(content);
var parentFolder = NotesFolderFS(null, tempDir.path);
var note = Note(parentFolder, notePath);
await note.load();
var checklist = Checklist(note);
/*
for (var node in checklist.nodes) {
print("node $node - '${node.textContent}'");
}*/
checklist.addItem(checklist.buildItem(false, "Five"));
note = checklist.note;
expect(note.body, "[ ] One\n[ ]Two\n[ ] Three\n[ ] Four\n[ ] Five\n");
});
});
}