Markdown Code Formatter

Install and Setup

In your project's directory with a dprint.json file, run:

dprint config add markdown

This will update your config file to have an entry for the plugin. Then optionally specify a "markdown" property to add configuration:

{
  "markdown": {
    // markdown config goes here
  },
  "plugins": [
    "https://plugins.dprint.dev/markdown-x.x.x.wasm"
  ]
}

Code block formatters

Code blocks are formatted based on the other provided plugins. For example, if you wish to format JSON, TypeScript, and JavaScript code blocks, then ensure those plugins are also specified in the list of plugins to use.

{
  "plugins": [
    "https://plugins.dprint.dev/typescript-x.x.x.wasm",
    "https://plugins.dprint.dev/json-x.x.x.wasm",
    "https://plugins.dprint.dev/markdown-x.x.x.wasm"
  ]
}

Configuration

See Configuration

Playground

See Playground

Ignore Comments

Use an ignore comment:

<!-- dprint-ignore -->
Some              text

Or a range ignore:

<!-- dprint-ignore-start -->

Some    text

* other    text
*           testing

<!-- dprint-ignore-end -->