prettier / prettier/prettier

Support markdown callouts/admonitions

Open
#8,640 5 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted lang:markdown
Dominant language
JavaScript
Stars
52.3k
Forks
5k
Avg merge
19h 2m
Merged PRs (30d)
117

Description

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Playground using the markdown parser and proseWrap set to always, then trace the Markdown parser and printer behavior for ::: callouts. Done means all four input forms retain their callout boundaries and expected formatting without collapsing the content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, markdown
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.