Skip to content

inconsistent output between html(htmlWhitespaceSensitivity: "ignore") and jsx #6336

Closed

Description

@JounQin

Prettier 1.18.2
Babel Parser Playground link

HTML Parser Playground link

# Options (if any):
--html-whitespace-sensitivity ignore

Input:

<Hello>
  test     <World      />         test
</Hello>

Output:

// babel
<Hello>
  test <World /> test
</Hello>;

// html
<Hello>
  test
  <World />
  test
</Hello>

Expected behavior:
Should output same content(ignore the last semi).

Activity

  1. added
    lang:html
    status:needs discussion
    on Aug 8, 2019
  2. alexander-akait commented on Aug 8, 2019

    @alexander-akait
    Member

    I think because jsx and html is not same even with htmlWhitespaceSensitivity option

  3. thorn0 commented on May 6, 2020

    @thorn0
    Member

    --html-whitespace-sensitivity doesn't and shouldn't affect JSX.

  4. added
    locked-due-to-inactivity
    on Aug 5, 2020
  5. locked as resolved and limited conversation to collaborators on Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:htmllocked-due-to-inactivitystatus:needs discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions