10c - review: link and code span edges named in the README, 10e filed, leafEdges trail simplified
CI / gate (push) Successful in 40s
CI / publish (push) Has been skipped

This commit is contained in:
2026-09-26 13:26:20 +02:00
parent 613dc0edbb
commit f594dafc5b
4 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ does not come back.
`_(link card not included)_`, `_(extension not included)_`.
- `code`, `em`, `link`, `strike` and `strong` stay; every other mark drops, keeping its text, and
so does a mark CommonMark cannot spell where it stands.
- A newline in text is a hard break, edge whitespace is trimmed, carriage returns and null
- A newline in text is a hard break, edge whitespace outside a link or code span is trimmed, carriage returns and null
characters are removed, and an empty paragraph drops.
- An ordered list numbered past `999999999`, or adjacent ordered lists whose numbering does not
continue, is one bullet list keeping its numbers as text.
+2 -2
View File
@@ -221,9 +221,9 @@ function leafEdges(leaf: AdfNode, previous: AdfNode | undefined, next: AdfNode |
const text = leaf.text
if (text === undefined || marks.some((mark) => mark.type === 'code')) return undefined
const lead = text.slice(0, text.search(/[^ \t]|$/))
const trail = text.slice(Math.max(lead.length, text.search(/[ \t]*$/)))
const trail = text.slice(text.search(/[ \t]*$/))
const leadDepth = edgeDepth(marks, previous, lead)
const trailDepth = edgeDepth(marks, next, lead === text ? text : trail)
const trailDepth = edgeDepth(marks, next, trail)
if (leadDepth === marks.length && trailDepth === marks.length) return undefined
if (lead === text) return leadDepth === undefined || trailDepth === undefined ? [] : [textLeaf(text, marks.slice(0, Math.min(leadDepth, trailDepth)))]
const edges: AdfNode[] = []
+1 -1
View File
@@ -1,8 +1,8 @@
import type { AdfDocument, AdfNode } from '../../adf/document.ts'
import { adfDocumentFault, nodeAttrs, nodeContent } from '../../adf/document.ts'
import { adfToMarkdown, commonMarkSpelling, largestListMarker, type SpellingMemo } from './adf-to-markdown.ts'
import { alertMarker, foldedAlertMarker, taskMarker } from '../plain-conventions.ts'
import { blockNodeModel } from '../../adf/block-nodes.ts'
import { adfToMarkdown, commonMarkSpelling, largestListMarker, type SpellingMemo } from './adf-to-markdown.ts'
import { failure, faulted, success, type ConvertErrorPath, type Result } from '../../result.ts'
import { inlineLeaves, isBlockNodeType, oneLine, reduceInline, writableHref } from './plain-inline.ts'
import { inlineNodeModel } from '../../adf/inline-nodes.ts'
+8
View File
@@ -266,6 +266,14 @@ chunk clearing a §11 seam.
it is a gap to ask. The same class runs the other way: a highlighted `=` writes `=====`, which
reads back as text, and a highlighted `a==b` writes `==a==b==`, highlighting `a` alone; 10c's
byte-for-byte property misses both, since the wrong document re-spells to the same bytes.
- [ ] **10e — A callout's body stays its body.** `plainMarkdownToAdf` reads Obsidian's own
spelling, `> [!faq]- Why?` with the body on the next `>` line, as an expand titled with the
whole paragraph — `"Why? See the docs and code."` — and an empty body, dropping the link
target and the code mark Goal 5 keeps; an unfolded `> [!tip] Title` merges the title into
the body's first line. Item 10's settled "the rest of the marker's paragraph as its title"
reads against Goal 5 here, and the line edge is gone once `markdownToAdf` has joined the
paragraph, so which seam reads it is part of the gap to ask: candidate rule "the title is
the marker's line; the lines after it open the body" (10c's review, 2026-09-26).
- [x] **11 — Atlassian's ADF schema as the tables' truth.**
- [x] **11a — The vendored schema.**
- [x] **11b — The gate.**