3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +01:00

Answer stability round 1: 0 🔴, 2 🟡 (0 misread); test each pair once, and log the breaking reading

This commit is contained in:
2026-11-15 22:39:02 +01:00
committed by Lillem4n
parent e8a491072c
commit 1ad449f083
5 changed files with 2 additions and 21 deletions
+1
View File
@@ -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 `<figure class="adf-media-single">` holding an
+1 -7
View File
@@ -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'))
})
@@ -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', () => {
@@ -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}`, () => {
-10
View File
@@ -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