Skip to content

Paragraph starting with a decimal number is moved into preceding list (MDX) #11332

@TrevorBurnham

Description

@TrevorBurnham

Prettier 2.3.2
Playground link

--parser mdx
--arrow-parens avoid
--trailing-comma none

Input:

- A list item.

1.x Some text below the list that starts with "1.x"

Output:

- A list item.

  1.x Some text below the list that starts with "1.x"

Expected behavior:

The text below the list should not be indented. In addition to being aesthetically unpleasant, the indentation actually changes the meaning of the code, as you can confirm in the MDX Playground:

  • Without the indentation, the text starting with "1.x" is a separate paragraph outside of the list.
  • With the indentation, the text starting with "1.x" is a paragraph within the list item above it.

AFAICT this bug occurs whenever a line of text after a paragraph starts with a string of the form \d\.\S+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions