mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-20 07:05:44 +01:00
Read an image alone on an alert's marker line or the lines after it as the image, as a reader panel expected; item 88 filed
This commit is contained in:
@@ -231,12 +231,15 @@ test('reads what CommonMark reads where no row reads, a directive and a carry fe
|
||||
assert.deepEqual(read('a !adf:carry{json="{}"} \\!adf:x\n'), [said('a !adf:carry{json="{}"} !adf:x')])
|
||||
assert.deepEqual(read('```adf:blockCard\n{}\n```\n'), [node('codeBlock', { language: 'adf:blockCard' }, text('{}'))])
|
||||
const linked = paragraph(text('a', { attrs: { href: 'u' }, type: 'link' }))
|
||||
assert.deepEqual(read('> [!tip] \n'), [panel('tip', linked)])
|
||||
assert.deepEqual(read('> [!tip]\n> \n'), [panel('tip', linked)])
|
||||
const image = node('mediaSingle', { layout: 'center' }, { attrs: { alt: 'a', type: 'external', url: 'u' }, type: 'media' })
|
||||
assert.deepEqual(read('> [!tip] \n'), [panel('tip', image)])
|
||||
assert.deepEqual(read('> [!tip]\n> \n'), [panel('tip', image)])
|
||||
assert.deepEqual(read('> [!tip]\n>\n> \n'), [panel('tip', image)])
|
||||
assert.deepEqual(read('> [!tip]\n>  b\n'), [panel('tip', paragraph(...(linked.content ?? []), text(' b')))])
|
||||
assert.deepEqual(read('> [!NOTE]- t\n> \n'), [node('expand', { title: 't' }, image)])
|
||||
assert.deepEqual(read('> [!NOTE]- \n'), [node('expand', { title: 'a (u)' }, paragraph())])
|
||||
assert.deepEqual(read('> [!NOTE]- t\n> \n'), [node('expand', { title: 't' }, linked)])
|
||||
assert.deepEqual(read('- [x] \n'), [bare('taskList', task('DONE', ...(linked.content ?? [])))])
|
||||
assert.deepEqual(read('> [!tip]\n>\n> \n'), [panel('tip', node('mediaSingle', { layout: 'center' }, { attrs: { alt: 'a', type: 'external', url: 'u' }, type: 'media' }))])
|
||||
assert.deepEqual(read('- [x]\n \n'), [bare('taskList', task('DONE', ...(linked.content ?? [])))])
|
||||
let deep = 'x\n'
|
||||
for (let level = 0; level < largestNesting; level += 1) deep = `> ${deep}`
|
||||
assert.equal(typeof read(deep), 'object')
|
||||
|
||||
Reference in New Issue
Block a user