3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 07:32:58 +01:00

Answer stability round 1: 0 🔴, 6 🟡 (0 misread); restore inlineRuns's early exit, one mark equality, refuse a pass taking no mark, pin the carried range and the opening link's run

This commit is contained in:
2026-11-03 21:54:29 +01:00
committed by Lillem4n
parent f912d81371
commit bcdf224e4c
7 changed files with 61 additions and 17 deletions
@@ -465,6 +465,11 @@ test('writes what the editor-normal form of the document writes', () => {
assert.equal(portable(paragraph({ marks: [{ attrs: {}, type: 'code' }], text: 'a', type: 'text' }, { marks: [{ type: 'code' }], text: '|b', type: 'text' })), '`a|b`\n')
})
test('keeps the code mark of a node past an opening link when the fallback drops the link\'s own', () => {
const link: AdfMark = { attrs: { href: 'u' }, type: 'link' }
assert.equal(portable(paragraph(text('x]: y', link, code), text('z', code))), '[x\\]: y](u)`z`\n')
})
test('writes a text node holding content the same in either order beside its neighbour', () => {
const holding: AdfNode = { content: [text('inner')], text: 'a', type: 'text' }
assert.equal(portable(paragraph(holding, text('b'))), 'ab\n')