41 - review: title text keeps its own spelling, only a node without text reads as the reduction does
CI / gate (push) Successful in 41s
CI / publish (push) Has been skipped

This commit is contained in:
2026-09-30 17:01:15 +02:00
parent 3f2f63aac0
commit 8d9d1ecb5b
3 changed files with 10 additions and 5 deletions
+7 -3
View File
@@ -131,9 +131,13 @@ function quoteNode(blocks: readonly Block[], reading: Reading, path: ConvertErro
const title = parseInlineContent(line, reading.definitions, path, 'paragraph', 'lossless')
if (!title.ok) return title
if (title.value.image !== undefined) return failure('unmappable-image', imageOnMarkerLine, path)
const leaves = inlineLeaves(title.value.nodes, 'paragraph', path, depth)
if (!leaves.ok) return leaves
const text = titleText(leaves.value)
const leaves: AdfNode[] = []
for (const [index, node] of title.value.nodes.entries()) {
const held = node.text === undefined ? inlineLeaves([node], 'paragraph', [...path, 'content', index], depth) : success([node])
if (!held.ok) return held
leaves.push(...held.value)
}
const text = titleText(leaves)
const type = reading.inExpand ? 'nestedExpand' : 'expand'
return filledNode(text === '' ? { type } : { attrs: { title: text }, type }, readMarked(paragraphsOf(led.position, rest), false, body, { ...reading, inExpand: true }, path, depth))
}