3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 07:32:58 +01:00

Answer principles round 1: 0 🔴, 2 🟡 (0 misread); writtenText alone tracks its prefixes, the walk's bound comment says what the check does now, markdown tested at the bound

This commit is contained in:
2026-10-29 14:07:44 +01:00
committed by Lillem4n
parent 28ae354315
commit 1ff3ad6e9b
4 changed files with 41 additions and 21 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ export function walkBlocks(nodes: readonly AdfNode[], path: ConvertErrorPath, de
for (const [index, node] of nodes.entries()) {
const block = emitBlock(node, [...path, 'content', index], depth, writing)
if (!block.ok) return block
// Refused here, so an engine holding longer strings stops at the block where V8 throws.
// Refused on the measure, before any text is written, so every engine stops at the first block past the bound.
const fits = withinLongest(block.value.text.length, block.value)
if (!fits.ok) return fits
headroom = Math.min(headroom, block.value.headroom)