3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-20 23:25:43 +01:00

Answer prose round 2: the edge-whitespace comment names the real spelling, the Raw HTML paragraph loses its half clause, items 75 and 77 read once

This commit is contained in:
2026-10-04 23:01:16 +02:00
committed by Lillem4n
parent 8e6e434c63
commit 640772bc0f
3 changed files with 14 additions and 15 deletions
+2 -3
View File
@@ -196,9 +196,8 @@ is the fence.
CommonMark input may contain raw HTML. `markdownToAdf` routes each construct through the foreign CommonMark input may contain raw HTML. `markdownToAdf` routes each construct through the foreign
HTML element mapping (`docs/decisions.md` §Foreign HTML sorts three ways; specified with the HTML HTML element mapping (`docs/decisions.md` §Foreign HTML sorts three ways; specified with the HTML
dialect) — ADF has no raw-HTML node, so a construct without a mapping, comments dialect) — ADF has no raw-HTML node, so a construct without a mapping, comments and processing
and processing instructions included, is an error result naming it. The flavour never emits raw instructions included, is an error result naming it. The flavour never emits raw HTML.
HTML.
## Block nodes ## Block nodes
+1 -1
View File
@@ -130,7 +130,7 @@ function lineVerdict(segments: readonly InlineSegment[], container: LineContaine
return run === undefined ? { kind: 'line', text: assembled.line } : { kind: 'unspellable-run', runs: [run, ...others] } return run === undefined ? { kind: 'line', text: assembled.line } : { kind: 'unspellable-run', runs: [run, ...others] }
} }
// A space or tab CommonMark strips at a line edge rides !adf:text{} instead. // A space or tab CommonMark strips at a line edge rides !adf:text{text="…"}.
function spellEdgeWhitespace(segments: readonly InlineSegment[]): InlineSegment[] { function spellEdgeWhitespace(segments: readonly InlineSegment[]): InlineSegment[] {
const spelled: InlineSegment[] = [] const spelled: InlineSegment[] = []
for (const [index, segment] of segments.entries()) { for (const [index, segment] of segments.entries()) {
+11 -11
View File
@@ -133,13 +133,13 @@ read as `spec/flavour.md` says. Breaking: `MIGRATION.md` says which call a calle
### 77. Decide whether Goal 1 promises a result for plain data only, or for any value, getters and Proxies included. ### 77. Decide whether Goal 1 promises a result for plain data only, or for any value, getters and Proxies included.
`docs/decisions.md` §No value `JSON.parse` or `structuredClone` builds loops a call leaves getters, The `docs/decisions.md` entry "No value `JSON.parse` or `structuredClone` builds loops a call"
Proxies and non-enumerable keys to the caller, so `adfToMarkdown`, `adfToPlainMarkdown` and leaves getters, Proxies and non-enumerable keys to the caller, so `adfToMarkdown`,
`isAdfDocument` throw on a revoked Proxy or a throwing getter, and walk forever on a getter that `adfToPlainMarkdown` and `isAdfDocument` throw on a revoked Proxy or a throwing getter, and walk
mints a fresh child per access. Goal 1 says every call returns a result. Either Goal 1 names plain forever on a getter that mints a fresh child per access. Goal 1 says every call returns a result.
data, as the README's guarantees already do, or an item wraps the guard walk in a tight `try/catch` Either Goal 1 names plain data, as the README's guarantees already do, or an item wraps the guard
returning `not-an-adf-document` with a bound on nodes visited, and the decision cites it. The walk in a tight `try/catch` returning `not-an-adf-document` with a bound on nodes visited, and that
maintainer's call. Found by the technical-principles audit, 2026-10-04. entry cites the item. The maintainer's call. Found by the technical-principles audit, 2026-10-04.
### 68. Carry a non-text inline node holding `content` or `text`, a block holding `text`, and a leaf block holding `content`. ### 68. Carry a non-text inline node holding `content` or `text`, a block holding `text`, and a leaf block holding `content`.
@@ -152,10 +152,10 @@ audit, 2026-10-04.
### 75. Make the generated-markdown property write block carries as `adf:` fences, canonical and hostile. ### 75. Make the generated-markdown property write block carries as `adf:` fences, canonical and hostile.
`blockCarry` and `hostileBlockCarry` (`src/conformance/markdown-property.test.ts`) write a fence `blockCarry` and `hostileBlockCarry` (`src/conformance/markdown-property.test.ts`) write a fence
whose info string is `carry`, an ordinary code language since §The carry fence names the node type. whose info string is `carry`. Under the `docs/decisions.md` entry "The carry fence names the node
So the property reaches `readCarriedBlock`'s refusals only where a random edit lands in a canonical type", that is an ordinary code language, so the property reaches `readCarriedBlock`'s refusals only
document. Write `adf:<type>` and `adf:` fences, canonical and hostile. Found by the where a random edit lands in a canonical document. Write `adf:<type>` and `adf:` fences, canonical
technical-principles audit, 2026-10-04. and hostile. Found by the technical-principles audit, 2026-10-04.
### 65. Read an image not alone in its paragraph as its alt text linked to its URL, and a titled image alone in its paragraph as the image captioned with its title. ### 65. Read an image not alone in its paragraph as its alt text linked to its URL, and a titled image alone in its paragraph as the image captioned with its title.