🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP →
Sign In

prettier-plugin-markdown-html

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-markdown-html

Format raw HTML in Markdown with Prettier

latest
Source
npmnpm
Version
1.4.1
Version published
Maintainers
1
Created
Source

Image

prettier-plugin-markdown‑html

Format raw HTML in Markdown with Prettier.

Image Image Image

 

Overview

This plugin adds an extra level of consistency to Markdown files by formatting raw HTML fragments.

  • Works with README.md and any other GitHub-Flavored Markdown document.
  • Respects Prettier’s built-in HTML options.
  • Comes without any additional dependencies.

Install

npm install --save-dev prettier-plugin-markdown-html
pnpm add --save-dev prettier-plugin-markdown-html

Usage

Reference prettier-plugin-markdown-html in your Prettier config:

{
    "plugins": [
        "prettier-plugin-markdown-html"
    ]
}

Options

In addition to Prettier’s built-in options that affect HTML formatting, prettier-plugin-markdown-html offers additional configuration options.

interface PluginOptions {
    /**
     * Override the preferred line length for raw HTML fragments in Markdown.
     * Unlike `printWidth`, this option does not affect code blocks or other
     * Markdown content. Falls back to `printWidth` when unset.
     * @default undefined
     */
    htmlFragmentPrintWidth?: number | undefined;
    /**
     * Enforce one HTML attribute per line for raw HTML fragments in Markdown.
     * Unlike `singleAttributePerLine`, this option does not affect code blocks.
     * Falls back to `singleAttributePerLine` when unset.
     * @default undefined
     */
    htmlFragmentSingleAttributePerLine?: boolean | undefined;
    /**
     * Control whitespace handling for raw HTML fragments in Markdown. Unlike
     * `htmlWhitespaceSensitivity`, this option does not affect code blocks.
     * Falls back to `htmlWhitespaceSensitivity` when unset.
     * @default undefined
     */
    htmlFragmentWhitespaceSensitivity?: 'css' | 'strict' | 'ignore' | undefined;
}

License

MIT © Dom Porada

Keywords

formatting

FAQs

Package last updated on 13 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts