fix(yaml): preserve trailing whitespace in block scalars (#19764)

This commit is contained in:
Максим Иванов authored and GitHub committed 2026-08-25 02:39:42 +08:00
1 parent 5486f283f2
commit 2556c4c89b
9 files changed
+163 -30

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#### Preserve trailing whitespace in YAML block scalars (#19764 by @splincode)
Prettier now preserves trailing spaces, tabs, and whitespace-only lines when formatting literal and folded YAML block scalars.
```js
await prettier.format("foo: |-\n value \n", { parser: "yaml" });
/* Prettier stable */
// -> "foo: |-\n value\n"
/* Prettier main */
// -> "foo: |-\n value \n"
// ^^ spaces preserved
```