10c - a list standing in a list or task list keeps its numbers as text past the marker cap
CI / gate (push) Successful in 41s
CI / publish (push) Has been skipped

This commit is contained in:
2026-09-26 13:28:13 +02:00
parent f594dafc5b
commit 9e2c0fda15
2 changed files with 3 additions and 1 deletions
@@ -306,6 +306,7 @@ test('drops an empty paragraph and merges adjacent lists of one type', () => {
assert.equal(plain(ordered(2, 'a'), ordered(3, 'b'), bulletList(item(said('c')))), '2. a\n3. b\n\n- c\n')
assert.equal(plain(bulletList(item(said('x'))), ordered(1, 'a'), ordered(5, 'b'), ordered(6, 'c')), '- x\n- 1\\. a\n- 5\\. b\n\n6. c\n')
assert.equal(plain(ordered(1, 'a'), ordered(1e10, 'y')), '- 1\\. a\n- 10000000000. y\n')
assert.equal(plain(node('taskList', {}, ordered(1e10, 'y')), bulletList(ordered(1e10, 'z'))), '- - 10000000000. y\n- - 10000000000. z\n')
const column = (list: AdfNode): AdfNode => node('layoutColumn', {}, list)
assert.equal(plain(node('layoutSection', {}, column(bulletList(item(said('a')))), column(bulletList(item(said('b')))))), '- a\n- b\n')
})
+2 -1
View File
@@ -78,7 +78,8 @@ function reduceNode(node: AdfNode, reduction: Reduction): Result<AdfNode[]> {
}
function reduceStanding(node: AdfNode, reduction: Reduction): Result<AdfNode[]> {
return standsInline(node) ? paragraphOf([node], reduction) : reduceNode(node, reduction)
const blocks = standsInline(node) ? paragraphOf([node], reduction) : reduceNode(node, reduction)
return blocks.ok ? plainSequence(blocks.value, reduction) : blocks
}
function standsInline(node: AdfNode): boolean {