Repository navigation
Replies: 1 comment
|
Please provide a link to this MDC. Add it to the proposal. In particular, a link to the spec. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Biome team 👋
First of all, thank you for the Markdown support in 2.6 — the new parser and formatter are a great addition, and I really appreciate the work that went into them. I'd like to share one case that currently makes the Markdown formatter hard to use with Nuxt Content.
What I'd like to see
Support for MDC component block syntax (the
remark-directivestyle), which Nuxt Content uses for block-level components. A simple example looks like this:The opening line is
::followed by a component name (letters, digits, and dashes), optionally followed by{...}props. The block ends with a line that contains only::. Blocks can also be nested:What happens today
The Markdown parser reads these lines as ordinary paragraph text. When the formatter is enabled,
biome format --writeturns the opening line into a heading:## ::alert{type=warning}and shifts the following lines around. The rendered page loses the component and shows a heading instead, so the whole document breaks.
Suggestion
It would be great if unrecognized
::nameblocks could be preserved verbatim (or skipped by the formatter) instead of being reinterpreted as Markdown. A dedicated parser option for MDC / generic directive blocks would be even better, so the blocks can be handled as opaque containers.I ran into this after upgrading a Nuxt Content docs site from 2.5.15 to 2.6: a single
biome check --writerewrote dozens of documentation files. For now I've disabledmarkdown.formatter, but I'd love to use Biome for Markdown again.Thanks for reading, and thanks again for all the work on Biome!
All reactions