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 {