From 9e2c0fda15c33c56ba6658e33d2c17434e3fab41 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 26 Sep 2026 13:28:13 +0200 Subject: [PATCH] 10c - a list standing in a list or task list keeps its numbers as text past the marker cap --- src/markdown/emit/plain-reduction.test.ts | 1 + src/markdown/emit/plain-reduction.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/markdown/emit/plain-reduction.test.ts b/src/markdown/emit/plain-reduction.test.ts index 8b82372..0b94ead 100644 --- a/src/markdown/emit/plain-reduction.test.ts +++ b/src/markdown/emit/plain-reduction.test.ts @@ -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') }) diff --git a/src/markdown/emit/plain-reduction.ts b/src/markdown/emit/plain-reduction.ts index efd6595..ea7d710 100644 --- a/src/markdown/emit/plain-reduction.ts +++ b/src/markdown/emit/plain-reduction.ts @@ -78,7 +78,8 @@ function reduceNode(node: AdfNode, reduction: Reduction): Result { } function reduceStanding(node: AdfNode, reduction: Reduction): Result { - 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 {