From 4b314725d8d0ec1cbdf43918e1a43adce1e113f4 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 9 Nov 2026 00:09:15 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=203=20=F0=9F=9F=A1=20(0=20misread);=20pin=20the?= =?UTF-8?q?=20stripped=20spaces=20after=20a=20marker,=20assert=20the=20wri?= =?UTF-8?q?ter's=20refusal,=20drop=20a=20code-derived=20expectation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/markdown/portable/adf-to-portable-markdown.test.ts | 8 +++++--- src/markdown/portable/portable-markdown-to-adf.test.ts | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/markdown/portable/adf-to-portable-markdown.test.ts b/src/markdown/portable/adf-to-portable-markdown.test.ts index 7d137c9..414985b 100644 --- a/src/markdown/portable/adf-to-portable-markdown.test.ts +++ b/src/markdown/portable/adf-to-portable-markdown.test.ts @@ -504,9 +504,11 @@ test('writes a task list nested to the deepest level the reader carries, and ref assert.equal(written.split('\n').length, largestNesting + 1) const refused = adfToPortableMarkdown(document(nested(largestNesting + 1))) assert.deepEqual(refused.ok ? undefined : [refused.error.code, refused.error.path], ['unsupported-nesting-depth', ['content', 0, ...Array.from({ length: largestNesting }, () => ['content', 1]).flat(), 'content', 0]]) - const quoted = (levels: number): string => portable(node('panel', { panelType: 'info' }, nested(levels))) - assert.ok(portableMarkdownToAdf(quoted(largestNesting - 1)).ok) - assert.match(quoted(largestNesting), /^unsupported-nesting-depth at \//) + const quoted = (levels: number) => adfToPortableMarkdown(document(node('panel', { panelType: 'info' }, nested(levels)))) + const fits = quoted(largestNesting - 1) + assert.ok(fits.ok && portableMarkdownToAdf(fits.value).ok) + const crowded = quoted(largestNesting) + assert.equal(crowded.ok ? undefined : crowded.error.code, 'unsupported-nesting-depth') }) test('writes a task list nested in the task before it, and more than one beside each other in that task', () => { diff --git a/src/markdown/portable/portable-markdown-to-adf.test.ts b/src/markdown/portable/portable-markdown-to-adf.test.ts index 901e830..71cf3a9 100644 --- a/src/markdown/portable/portable-markdown-to-adf.test.ts +++ b/src/markdown/portable/portable-markdown-to-adf.test.ts @@ -224,6 +224,11 @@ test('keeps a backslash a title line ends in as text, a break only before a foll assert.deepEqual(read('> [!NOTE]- x\\\\\n> body\n'), [node('expand', { title: 'x\\' }, said('body'))]) }) +test('strips every space and tab after a callout marker, whatever the callout', () => { + assert.deepEqual(read('> [!faq]- \t t\n'), [node('expand', { title: 't' }, paragraph())]) + assert.deepEqual(read('> [!NOTE] \t first\n>\n> x\n'), [panel('info', said('first'), said('x'))]) +}) + test('keeps the target of a link in a title whichever marks sit beside the link', () => { const titled = (markdown: string): unknown => { const blocks = read(markdown) @@ -271,7 +276,6 @@ test('places a refusal in a bullet list by the list and the item holding it', () test('reads a task whose marker line holds only breaks and spaces by the lines after it', () => { assert.deepEqual(read('- [ ] a\n b\n'), [bare('taskList', task('TODO', text('a b')))]) - assert.deepEqual(read('- [ ] \\\n \\\n x\n'), [bare('taskList', task('TODO', text('x')))]) assert.deepEqual(read('- [x]\n\n Second.\n- [ ] Next\n'), [bare('taskList', task('DONE', text('Second.')), task('TODO', text('Next')))]) assert.deepEqual(read('- [x]\n\n First.\n\n Second.\n'), [bare('taskList', node('blockTaskItem', { state: 'DONE' }, said('First.'), said('Second.')))]) assert.deepEqual(read('- [x]\n- [ ]\n'), [bare('taskList', task('DONE'), task('TODO'))])