Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdx v2: Should preserve newlines inside jsx #11857

Closed
ferdinandant opened this issue Nov 23, 2021 · 1 comment
Closed

mdx v2: Should preserve newlines inside jsx #11857

ferdinandant opened this issue Nov 23, 2021 · 1 comment
Labels
lang:mdx Issues affecting the MDX extension to Markdown (not general Markdown issues) type:bug Issues identifying ugly output, or a defect in the program

Comments

@ferdinandant
Copy link

ferdinandant commented Nov 23, 2021

Prettier 2.4.1
Playground link

--parser mdx

Input:

export function Message(props) {
  return props.children
}

<Message>
  aaa
  
  aaa
  
  aaa
</Message>

Output:

export function Message(props) {
  return props.children;
}

<Message>aaa aaa aaa</Message>

Expected behavior:
Newlines inside <Message> should be preserved because mdx (as of version 2) now treats them as separate paragraph
blocks. Try it here: https://mdxjs.com/playground/

export function Message(props) {
  return props.children
}

<Message>
  aaa
  
  aaa
  
  aaa
</Message>
@sosukesuzuki sosukesuzuki added lang:mdx Issues affecting the MDX extension to Markdown (not general Markdown issues) type:bug Issues identifying ugly output, or a defect in the program labels Nov 25, 2021
@kachkaev
Copy link
Member

kachkaev commented Feb 1, 2022

I created #12209 to track MDX 2 support. I am going to close this issue in favour of a more generic one. Hope it’s fine 🤞

@kachkaev kachkaev closed this as completed Feb 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:mdx Issues affecting the MDX extension to Markdown (not general Markdown issues) type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

3 participants