prettier/prettier

Support markdown callouts/admonitions

Offen

#8.640 geöffnet am 25.06.2020

 (5 Kommentare) (13 Reaktionen) (0 zugewiesene Personen)JavaScript (4.987 Forks)batch import
help wantedlang:markdown

Repository-Metriken

Stars
 (52.204 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T) (186 gemergte PRs in 30 T)

Beschreibung

Docusaurus has one non-standard markdown syntax extension - Callouts/admonitions. Currently this syntax doesn't play nice with Prettier, especially with proseWrap set to always.

Since it's not a part of CommonMark spec I'd understand if Prettier team wouldn't want to take an extra maintenance cost. But given that Docusaurus is quite popular (it's used by Prettier itself), this syntax doesn't seem to be conflicting with anything else, and it has a remark plugin, I thought opening this issue might worth a shot.


Prettier 2.0.5 Playground link

--parser markdown
--prose-wrap always

Input:

:::note
Some note
:::

:::note

Some note
:::

:::note
Some note

:::

::: note

Some note

:::

Output:

:::note Some note :::

:::note

Some note :::

:::note Some note

:::

::: note

Some note

:::

Expected behavior:

:::note
Some note
:::

:::note
Some note
:::

:::note
Some note
:::

:::note
Some note
:::

Contributor Guide