mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
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:
parent
c0a99786b3
commit
faef753730
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue