3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 22:55:44 +01:00

Answer architecture round 1: one owner for the image's ADF shape, the readings' decision, marker paragraphs, the exceptions the README names; items 87 filed and 56 widened

This commit is contained in:
2026-10-09 03:37:29 +02:00
parent aa08c1b61f
commit 08ca032979
14 changed files with 81 additions and 52 deletions
+3 -1
View File
@@ -1027,9 +1027,11 @@ test('reads an image no paragraph holds alone as its alt text, linked to its des
assert.deepEqual(firstContent('# ![a](/u)\n'), [marked('a', link('/u'))])
assert.deepEqual(firstContent('!adf:paragraph {localId=p}\n![a](/u)\n!adf:/paragraph\n'), [marked('a', link('/u'))])
assert.deepEqual(firstContent('![a ![b](/c) d\n'), [text('![a '), marked('b', link('/c')), text(' d')])
assert.deepEqual(content(losslessMarkdownToAdf('![a]\n')), [paragraph('![a]')])
assert.deepEqual(content(losslessMarkdownToAdf('a ! b\n')), [paragraph('a ! b')])
})
test('reads an image beside other content in a link as its alt text, the link\'s own text', () => {
test('reads an image inside a link not alone in its paragraph as plain alt text the link marks, dropping its own destination', () => {
assert.deepEqual(firstContent('See [![a](/u "t")](/v).\n'), [text('See '), marked('a', link('/v')), text('.')])
assert.deepEqual(firstContent('See [![](/u)](/v).\n'), [text('See '), marked('/v', link('/v')), text('.')])
assert.deepEqual(firstContent('[b ![a](/u)](/v)\n'), [marked('b a', link('/v'))])