mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-21 15:42:58 +01:00
Keep the one-fallback-per-pass loop in the properties, out of the writers' signatures
This commit is contained in:
@@ -412,11 +412,11 @@ test('gives up every highlight run whose own delimiter cannot flank in one fallb
|
||||
const highlight: AdfMark = { type: 'backgroundColor' }
|
||||
const line = [text('a '), text('x', highlight), text('a '), text('x', highlight), text('a '), text('x', highlight), text('a')]
|
||||
const runs = [{ depth: 0, first: 1, last: 1 }, { depth: 0, first: 3, last: 3 }, { depth: 0, first: 5, last: 5 }]
|
||||
assert.deepEqual(portableLineFallback(line, 'paragraph', [], () => false), { ok: true, value: { kind: 'unspellable-run', runs } })
|
||||
assert.deepEqual(portableLineFallback(line, 'paragraph', []), { ok: true, value: { kind: 'unspellable-run', runs } })
|
||||
})
|
||||
|
||||
test('refuses a portable line holding a node only the carry spells, at the line', () => {
|
||||
const refused = portableLineFallback([text('x', { type: 'odd' })], 'paragraph', ['content', 0], () => false)
|
||||
const refused = portableLineFallback([text('x', { type: 'odd' })], 'paragraph', ['content', 0])
|
||||
assert.deepEqual(refused.ok ? refused : [refused.error.code, refused.error.path], ['unsupported-node-shape', ['content', 0]])
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user