From bb83888d8f3b2c3ba97d13005a26059fadf8b9de Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 4 Oct 2026 21:09:51 +0200 Subject: [PATCH] Answer stability round 2: the carries comment names the carries it decides --- src/markdown/emit/inline-line.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markdown/emit/inline-line.ts b/src/markdown/emit/inline-line.ts index fcc586e..878c3e7 100644 --- a/src/markdown/emit/inline-line.ts +++ b/src/markdown/emit/inline-line.ts @@ -217,7 +217,7 @@ function nodePath(context: InlineContext, index: number): ConvertErrorPath { return [...context.path, 'content', index] } -// Whatever the node decides alone is decided here, so a line holding many such nodes is emitted once. +// Decides the text-node and slot-fault carries up front, so a line holding many of them is emitted once. function carries(node: AdfNode, carried: ReadonlySet, index: number): boolean { if (carried.has(index)) return true if (node.type === 'text') return !isBareText(node) || typeof node.text !== 'string' || node.text === '' @@ -263,7 +263,7 @@ function emitInlineDirective(node: AdfNode, model: InlineNodeModel, index: numbe return success({ segments: [syntax(spellInlineDirectiveOpener(node.type)), ...content, syntax(`]${attributes}`)] }) } -// spec/flavour.md, Inline nodes: CommonMark reads a carriage return as a line ending, and a null character as U+FFFD. +// spec/flavour.md, Text CommonMark cannot hold plainly. function emitText(node: AdfNode, context: InlineContext, index: number): Emission { if (!isBareText(node) || typeof node.text !== 'string' || node.text === '') return { carry: { first: index, last: index } } const escaping: InlineEscaping = context.bracketed ? 'bracketed' : 'backslash'