Closed
Description
Describe the bug
When serializing a blockquote with a line width of 21 or less, it is prefixed with additional whitespace.
To Reproduce
Run the following script:
import {parseDocument} from 'yaml'
let yaml = `comments: >
test test test test test test`
for(let i = 0; i < 10; i++) {
const doc = parseDocument(yaml)
yaml = doc.toString({
lineWidth: 22,
})
console.dir(yaml)
}
for(let i = 0; i < 10; i++) {
const doc = parseDocument(yaml)
yaml = doc.toString({
lineWidth: 21,
})
console.dir(yaml)
}
Expected behaviour
When serializing a document, and then parsing again, the same document is produced. This holds true for the first loop using a lineWidth
of 22, but not the second loop using a lineWidth
of 21.
Versions (please complete the following information):
- Environment: Node.js 22.5.1
yaml
: 2.4.5
Additional context
N/A