3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-20 07:05:44 +01:00

Answer architecture round 1: a token's width is true for every kind that carries one, the escape walk threads one record, the == step and the directive precondition say why, and item 96 files the inline HTML scan

This commit is contained in:
2026-10-09 16:48:34 +02:00
committed by Lillem4n
parent 9de333d318
commit 652ae60179
5 changed files with 67 additions and 36 deletions
+10 -2
View File
@@ -6,7 +6,7 @@
`Bar = 9`
`Next ID = 96`
`Next ID = 97`
| Goal | W |
|---|---|
@@ -34,6 +34,7 @@
| 62 | 0.2.0 | decision | **Move the portable flavour's reading out of `parse/` and its writing out of `emit/` into `markdown/portable/`, so `emit/` no longer imports `portable/`.** | 4 | 5 | 2 | 6 | 2 | 9.4 |
| 92 | 0.2.0 | | **Lower the reading cost of the files a chunk reads most before its first commit.** | 2 | 4 | 2 | 4 | 1 | 9.0 |
| 89 | 0.2.1 | | **Build a `date`, `emoji`, `inlineCard`, `mention` or `status` holding no mark Atlassian's schema withholds from it, in every reader.** | 4 | 4 | 5 | 6 | 4 | 13.0 |
| 96 | 0.2.1 | defect | **Read and write a text holding many `<!--`, `<?`, `<![CDATA[` or `<!` openers without a terminator in time linear in the text.** | 2 | 3 | 5 | 9 | 9 | 9.2 |
| 33 | 0.2.1 | defect | **Emit a line in time linear in its mark runs, in `adfToLosslessMarkdown` and `adfToPortableMarkdown`.** | 4 | 5 | 6 | 9 | 9 | 8.7 |
| 7 | 0.3.0 | decision | **Ship HTML: `adfToHtml`, `htmlToAdf`, and markdown to and from HTML composed through ADF, each call named by its flavour.** | 6 | 9 | 9 | 9 | 2, 4 | 25.8 |
| 45 | 0.3.0 | | **Replace `isAdfDocument` with a reader returning `Result<AdfDocument>`.** | 2 | 3 | 6 | 8 | 1 | 25.2 |
@@ -134,6 +135,12 @@ them 68188. Read most over the last five, opens and searches: `README.md` 32, `d
may reject the document. Replace `InlineNodeModel.takesMarks` (`src/adf/inline-nodes.ts`) with the
mark types a node takes, and have the emitter carry a node holding another.
### 96. Read and write a text holding many `<!--`, `<?`, `<![CDATA[` or `<!` openers without a terminator in time linear in the text.
`inlineHtmlConstruct` (`src/markdown/commonmark/grammar.ts`) searches the rest of the text for the
opener's terminator at every opener, so `<!--` repeated with no `-->` is quadratic in both
directions: the reader and the emitter's escape walk both ask it through `readInlineToken`.
### 33. Emit a line in time linear in its mark runs, in `adfToLosslessMarkdown` and `adfToPortableMarkdown`.
`adfToLosslessMarkdown` spends 23 s on one paragraph of 2000 × `un` plus `**-r**`: each run its
@@ -279,7 +286,8 @@ gains its row.
`src/markdown/emit/line-escaping.ts` asks the reader's tokens where text would read as syntax, but
`escapeClosedRuns` still works out which backtick strings an escape leaves, and `unspellableRuns`
rebuilds the reader's emphasis and highlight pairing to pick the run to carry. Reading the line
rebuilds the reader's emphasis and highlight pairing to pick the run to carry, and `lastLinkClose`
guesses which text `[` opens link text. Reading the line
back costs a parse per line attempt, and the run it picks may differ, changing output.
### 91. Spell an emphasis or link once across the hard breaks between two nodes it marks, in both writers.