docs: mention admonition quirks with Prettier (#6135)

* docs: mention admonition quirks with Prettier

* Update markdown-features-admonitions.mdx

* Update markdown-features-admonitions.mdx

* Update markdown-features-admonitions.mdx
This commit is contained in:
Yangshun Tay 2021-12-20 12:14:50 +08:00 committed by GitHub
parent c0a99786b3
commit faef753730
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,6 +69,28 @@ Some **content** with _markdown_ `syntax`. Check [this `api`](#).
::: :::
## Usage with Prettier {#usage-with-prettier}
If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might autoformat your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content.
<!-- prettier-ignore -->
```md
<!-- Prettier doesn't change this -->
::: note
Hello world
:::
<!-- Prettier changes this -->
::: note
Hello world
:::
<!-- to this -->
::: note Hello world:::
```
## Specifying title {#specifying-title} ## Specifying title {#specifying-title}
You may also specify an optional title You may also specify an optional title