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

Record that the first step checks every schema rule, and plan moving the writers' schema refusals there

This commit is contained in:
2026-11-04 20:47:10 +01:00
committed by Lillem4n
parent acc6df4e9f
commit 5af77d0a5e
4 changed files with 52 additions and 32 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ export function nodeMarks(node: { marks?: AdfMark[] }): readonly AdfMark[] {
return node.marks ?? []
}
// Walks every node, carried or of an unknown type, so a link-marked card is refused wherever it stands (docs/decisions.md §Writers and carry readers refuse an inline card a link marks).
// Walks every node, carried or of an unknown type, so a link-marked card is refused wherever it stands (docs/decisions.md §The first step checks the schema, and no converter does).
export function refusedShape(content: readonly AdfNode[]): ConvertError | undefined {
type Step = { index: number; node: AdfNode; parent: Step | undefined }
const pending: Step[] = content.map((node, index) => ({ index, node, parent: undefined })).reverse()