diff --git a/docs/options.md b/docs/options.md index 94fdd1541..2de984cd9 100644 --- a/docs/options.md +++ b/docs/options.md @@ -430,9 +430,39 @@ By default, Prettier will not change wrapping in markdown text since some servic Valid options: -- `"always"` - Wrap prose if it exceeds the print width. -- `"never"` - Un-wrap each block of prose into one line. -- `"preserve"` - Do nothing, leave prose as-is. _First available in v1.9.0_ +- `"always"` - Wrap prose to the `printWidth`. +- `"never"` - Put each prose block on a single line. +- `"preserve"` - Keep the existing wrapping as-is. _First available in v1.9.0_ + +For example, given this Markdown paragraph: + +```md +The quick brown +fox jumps over the lazy dog. +``` + +With `printWidth: 20`, Prettier formats it as: + +- `"always"` + + ```md + The quick brown fox + jumps over the lazy + dog. + ``` + +- `"never"` + + ```md + The quick brown fox jumps over the lazy dog. + ``` + +- `"preserve"` + + ```md + The quick brown + fox jumps over the lazy dog. + ``` | Default | CLI Override | API Override | | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | diff --git a/website/versioned_docs/version-stable/options.md b/website/versioned_docs/version-stable/options.md index 9f5bf1afe..1ec2796e2 100644 --- a/website/versioned_docs/version-stable/options.md +++ b/website/versioned_docs/version-stable/options.md @@ -430,9 +430,39 @@ By default, Prettier will not change wrapping in markdown text since some servic Valid options: -- `"always"` - Wrap prose if it exceeds the print width. -- `"never"` - Un-wrap each block of prose into one line. -- `"preserve"` - Do nothing, leave prose as-is. _First available in v1.9.0_ +- `"always"` - Wrap prose to the `printWidth`. +- `"never"` - Put each prose block on a single line. +- `"preserve"` - Keep the existing wrapping as-is. _First available in v1.9.0_ + +For example, given this Markdown paragraph: + +```md +The quick brown +fox jumps over the lazy dog. +``` + +With `printWidth: 20`, Prettier formats it as: + +- `"always"` + + ```md + The quick brown fox + jumps over the lazy + dog. + ``` + +- `"never"` + + ```md + The quick brown fox jumps over the lazy dog. + ``` + +- `"preserve"` + + ```md + The quick brown + fox jumps over the lazy dog. + ``` | Default | CLI Override | API Override | | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |