0717920c8dd81507218d40f47b782e62cded8835
setScalarValue reconstructed a block scalar's content indent as token.indent plus one step, but token.indent is the indent of the node, not of its contents. Contents sitting further in than one step were pulled back, and without afterKey they lost their indentation entirely, which for a block scalar in a collection changes what the document means rather than just how it looks. resolveBlockScalar already measures the real content indent when reading: an explicit indentation indicator counts from the node indent, and otherwise the indent is that of the first non-empty line. Measure the same way before stringifying, and fall back to the previous behaviour when a block scalar has no contents to measure. Fixes #349
Languages
TypeScript
100%