4c - the guard's spread was a class: the code block's held lines and a mark run's segments too

This commit is contained in:
2026-09-18 19:52:00 +02:00
parent 047ce3bc42
commit 0361646e1a
8 changed files with 31 additions and 15 deletions
+4
View File
@@ -118,3 +118,7 @@ test('closes the containers a closer names past as unclosed, and crosses no list
assert.deepEqual(kinds('!adf:rule {localId=a-1}\nPart.\n!adf:/rule\n'), ['fault', 'paragraph'])
assert.deepEqual(kinds('!adf:rule {localId=a-1}\n!adf:/rule\n!adf:/rule\n'), ['fault', 'fault'])
})
test("releases an indented code block's held blank lines as a walk rather than as one call's arguments", () => {
assert.deepEqual(kinds(` a\n${'\n'.repeat(200000)} b\n`), ['code'])
})
+2 -1
View File
@@ -365,7 +365,8 @@ function readIndentedCodeLine(leaf: Extract<OpenLeaf, { kind: 'indented-code' }>
return true
}
if (leadingColumns(line) < indentedCodeColumns) return false
leaf.lines.push(...leaf.held, removeColumns(line, indentedCodeColumns).text)
for (const held of leaf.held) leaf.lines.push(held)
leaf.lines.push(removeColumns(line, indentedCodeColumns).text)
leaf.held.length = 0
return true
}