docs: Improve Markdown trailing whitespace section (#19630)

This commit is contained in:
Peter Tripp
2024-10-23 13:23:01 -04:00
committed by GitHub
parent c6f08dea89
commit 8bfd27b00b
+15 -2
View File
@@ -21,13 +21,26 @@ def fib(n):
## Configuration
If you wish change the default language settings for Markdown files, perhaps to disable auto format on save or if your markdown relies upon trailing whitespace ` ` being converted to `<br />` you can add change these values in your `settings.json`:
### Format
Zed supports using Prettier to automatically re-format Markdown documents. You can trigger this manually via the {#action editor::Format} action or via the {#kb editor::Format} keyboard shortcut. Alternately, you can automattically format by enabling [`format_on_save`](./configuring-zed.md#format-on-save) in your settings.json:
```json
"languages": {
"Markdown": {
"remove_trailing_whitespace_on_save": true,
"format_on_save": "on"
}
},
```
### Trailing Whitespace
By default Zed will remove trailing whitespace on save. If you rely on invisible trailing whitespace being converted to `<br />` in Markdown files you can disable this behavior with:
```json
"languages": {
"Markdown": {
"remove_trailing_whitespace_on_save": false
}
},
```