mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-20 15:15:44 +01:00
Read a list whose bullet or ordered delimiter changes as two lists, and alternate the marker between adjacent lists in place of !adf:listBreak
This commit is contained in:
@@ -180,6 +180,12 @@ test('stands a block a task item cannot hold, and what follows it in the item, a
|
||||
])
|
||||
})
|
||||
|
||||
test('reads a task list beside a list of another bullet character as two lists', () => {
|
||||
const tasks = (state: string, value: string): AdfNode => bare('taskList', node('taskItem', { state }, text(value)))
|
||||
assert.deepEqual(read('- [x] a\n* b\n'), [tasks('DONE', 'a'), bare('bulletList', bare('listItem', bare('paragraph', text('b'))))])
|
||||
assert.deepEqual(read('- [x] a\n* [ ] b\n'), [tasks('DONE', 'a'), tasks('TODO', 'b')])
|
||||
})
|
||||
|
||||
test('leaves mixed, ordered and unmarked lists plain', () => {
|
||||
for (const markdown of ['- \\[x] a\n', '- [x] a\n- \\[ ] b\n', '- [x] a\n- b\n', '1. [x] a\n', '- [x]a\n', '- **[x]** a\n', '- [x]**a**\n', '- [-] a\n', '- > [x] a\n']) {
|
||||
const blocks = read(markdown)
|
||||
|
||||
Reference in New Issue
Block a user