From 1ad449f0830552d7764a858e1e69fcf71a8ecdd2 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 15 Nov 2026 22:39:02 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=202=20=F0=9F=9F=A1=20(0=20misread);=20test=20each?= =?UTF-8?q?=20pair=20once,=20and=20log=20the=20breaking=20reading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/markdown/commonmark/case-folding.test.ts | 8 +------- src/markdown/commonmark/link-syntax.test.ts | 2 -- src/markdown/parse/markdown-to-adf.test.ts | 2 -- todo.md | 10 ---------- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6004d3..3207845 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- **Breaking:** `commonMarkToAdf`, `losslessMarkdownToAdf` and `portableMarkdownToAdf` match a link reference to its definition under Unicode case folding, where `0.3.1` lowercased the label. `[ẞ]` with `[SS]: /url` reads as a link, and where two definitions' labels fold together, the first wins. `ı` and `I` stay two labels. - `adfToPortableMarkdown` writes a line of whitespace-only text nodes beside a hard break, every other one linked, in time linear in the number of nodes, where `0.3.1` took time quadratic in it. - `adfToPortableMarkdown` writes a line of code spans alternating with emphasized spaces in time linear in its length, where `0.3.1` took time quadratic in it. - `adfToHtml` writes a media single, a media group and a caption as `
` holding an diff --git a/src/markdown/commonmark/case-folding.test.ts b/src/markdown/commonmark/case-folding.test.ts index 5ff90c7..d37a396 100644 --- a/src/markdown/commonmark/case-folding.test.ts +++ b/src/markdown/commonmark/case-folding.test.ts @@ -24,7 +24,7 @@ const mappings = new Map( .map((match): [string, string] => [characters(match[1] ?? ''), characters(match[2] ?? '')]), ) -test('the vendored file gives the mappings the other tests hold the table to', () => { +test('the vendored file holds 1606 common and full mappings, `ẞ`, `ß` and `İ` among them', () => { assert.equal(mappings.size, 1606) assert.equal(mappings.get('ẞ'), 'ss') assert.equal(mappings.get('ß'), 'ss') @@ -52,9 +52,3 @@ test('folds a string code point by code point, a surrogate pair as one', () => { assert.equal(foldCase(''), '') assert.equal(foldCase('\ud801'), '\ud801') }) - -test('keeps the dotless i and the capital I apart, as the standard does', () => { - assert.equal(foldCase('I'), 'i') - assert.equal(foldCase('ı'), 'ı') - assert.notEqual(foldCase('ı'), foldCase('I')) -}) diff --git a/src/markdown/commonmark/link-syntax.test.ts b/src/markdown/commonmark/link-syntax.test.ts index 86f06d8..24433f3 100644 --- a/src/markdown/commonmark/link-syntax.test.ts +++ b/src/markdown/commonmark/link-syntax.test.ts @@ -51,8 +51,6 @@ test('a target reads whitespace and a title around its destination, bracketed, u test('a label folds under Unicode case folding after its whitespace collapses', () => { assert.equal(normalizeLabel(' Foo \n\t Bar '), 'foo bar') assert.equal(normalizeLabel('ẞ'), normalizeLabel('SS')) - assert.equal(normalizeLabel('Straße'), normalizeLabel('STRASSE')) - assert.equal(normalizeLabel('ς'), normalizeLabel('Σ')) }) test('a dotless i and a capital I stay two labels', () => { diff --git a/src/markdown/parse/markdown-to-adf.test.ts b/src/markdown/parse/markdown-to-adf.test.ts index 4e0687a..182a7b9 100644 --- a/src/markdown/parse/markdown-to-adf.test.ts +++ b/src/markdown/parse/markdown-to-adf.test.ts @@ -1083,8 +1083,6 @@ test('reads the reference links a definition resolves, and leaves the rest liter for (const read of [commonMarkToAdf, losslessMarkdownToAdf, portableMarkdownToAdf]) { test(`matches a reference to its definition under Unicode case folding in ${read.name}`, () => { assert.deepEqual(content(read('[ẞ]\n\n[SS]: /url\n')), [{ content: [marked('ẞ', link('/url'))], type: 'paragraph' }]) - assert.deepEqual(content(read('[Straße][]\n\n[STRASSE]: /url\n')), [{ content: [marked('Straße', link('/url'))], type: 'paragraph' }]) - assert.deepEqual(content(read('[a][ς]\n\n[Σ]: /url\n')), [{ content: [marked('a', link('/url'))], type: 'paragraph' }]) }) test(`keeps a dotless i and a capital I two labels in ${read.name}`, () => { diff --git a/todo.md b/todo.md index 0ec2500..236f801 100644 --- a/todo.md +++ b/todo.md @@ -12,7 +12,6 @@ | ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score | |---|---|---|---|---|---|---|---|---|---|---|---| -| 51 | 0.4.0 | | | **Match a reference label to its definition under Unicode case folding.** | 2 | 1 | 2 | 3 | 4 | 4 by 2 | 1.7 | | 148 | 0.4.0 | | | **Ship conversion between ADF and Jira wiki markup both ways, under a README goal for wiki markup.** | 3 | 2 | 2 | 5 | 7 | 3 by 5 | 0.8 | | 149 | 0.4.0 | | | **Read any HTML into ADF, in a call or option a developer panel picks, under a README goal for foreign HTML.** | 3 | 2 | 2 | 5 | 7 | 3 by 5 | 0.8 | | 172 | 0.4.0 | | principle | **Build one test per reader or case in place of a loop inside a test body, in the 26 test files that loop.** | 3 | 1 | 1 | 3 | 8 | code health by 2 | 0.6 | @@ -45,15 +44,6 @@ ## Details -### 51. Match a reference label to its definition under Unicode case folding. - -`link-syntax.ts` normalizes a label with `toLowerCase`, so `[ẞ]` misses its `[SS]` definition (spec -example 540). Fold with Unicode's full case folding, `CaseFolding.txt`'s C and F mappings, shipped -as data per §Standards ship as data: lowercasing and then uppercasing would also merge `ı` with -`I`, which folding keeps apart, so add that pair as a fixture. Breaking: `MIGRATION.md`'s Readings table -gains its row. Its `pending` exceptions go, and the README's guarantees drop the case-folding -exception and count one fewer. - ### 148. Ship conversion between ADF and Jira wiki markup both ways, under a README goal for wiki markup. Jira's REST API v2 and its changelogs carry wiki markup, and Atlassian's