Skip to content

Support setext headings in Markdown #6013

@ExE-Boss

Description

@ExE-Boss

Prettier 1.16.4

Playground link

{
	"parser": "markdown",
	"tabWidth": 4,
	"useTabs": true,

	/**
	 * `markdownHeadings` values:
	 * - `atx` (default)
	 * - `setext`
	 * - `setext-h1` (only `<h1>` uses the setext syntax)
	 */
	"markdownHeadings": "setext",
}

Input:

Setext Heading 1
================

Setext Heading 2
----------------

## ATX Heading 2

Output:

# Setext Heading 1

## Setext Heading 2

## ATX Heading 2

Expected behavior:

Setext headers are used:

Setext Heading 1
================

Setext Heading 2
----------------

ATX Heading 2
-------------

Preferably, I’d also like if there was an option to have only Heading 1 use the setext syntax, and the rest use the ATX syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:markdownIssues affecting Markdown

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions