#### Fix block value ends with whitespace (#18331 by @kovsu)

```js
import { inspect } from "node:util";
import * as prettier from "prettier";

const input = "foo: |\n  x\n   ";
const output = await prettier.format(input, { parser: "yaml" });
console.log(inspect(output));

// Prettier stable
//-> 'foo: |\n  x\n\n'

// Prettier main
//-> 'foo: |\n  x\n'
```
