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

Answer prose round 1: 0 🔴, 8 🟡; say which reader skips what, reorder the migration's keep-the-mark advice, file the decision title as a question

This commit is contained in:
2026-10-14 20:57:30 +02:00
committed by Lillem4n
parent 5886f76f96
commit e56291eb90
8 changed files with 44 additions and 36 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ export function inlineNodeModel(type: string): InlineNodeModel | undefined {
return Object.hasOwn(inlineNodes, type) ? inlineNodes[type] : undefined
}
// Undefined where the schema withholds no mark: the table lists no such type, text among them, but code text takes only `codeTextMarkTypes`.
// Undefined means every mark: the table lists only types the schema restricts, and it restricts text only when marked code.
export function takenMarkTypes(node: AdfNode): readonly string[] | undefined {
if (node.type === 'text') return nodeMarks(node).some((mark) => mark.type === 'code') ? codeTextMarkTypes : undefined
return inlineNodeModel(node.type)?.markTypes
+1 -1
View File
@@ -99,7 +99,7 @@ function emitLine(nodes: readonly AdfNode[], container: LineContainer, path: Con
}
}
// Seeds the withheld-mark carries once per line, so no run at any depth reads a node's marks whole.
// Seeds the withheld-mark carries once per line, so the run at each mark depth does not rescan every node's marks.
function freshFallbacks(nodes: readonly AdfNode[], flavour: WrittenFlavour): LineFallbacks {
const carried = new Set<number>()
for (const [index, node] of nodes.entries()) {