fix(yaml): preserve trailing whitespace in block scalars (#19764)
This commit is contained in:
1 parent
5486f283f2
commit
2556c4c89b
9 files changed
+163
-30
No files matched your search
@@ -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
|
||||
```
|
||||
Reference in new issue
Block a user