Skip to content

Doc of paragraph in markdown violates a rule of fill() #15877

@seiyab

Description

@seiyab

Prettier 3.1.1
Playground link

--parser markdown
--tab-width 4
--prose-wrap always

Input:

a a  
 b b  
 c c  

  

Doc:

[
  fill([
    "a",
    line,
    "a  ",
    markAsRoot(literalline),
    line,
    "b",
    line,
    "b  ",
    markAsRoot(literalline),
    line,
    "c",
    line,
    "c",
  ]),
  hardline,
]

Expected behavior:
The result doc should preserve the following invaliant:

// Expects doc.parts to be an array of alternating content and
// whitespace. The whitespace contains the linebreaks.

I haven't found user-facing problem yet. I found it investigating #15836 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:markdownIssues affecting Markdownlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions