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

Formatting mdx, from v2.0.0 to v2.1.2 now a new line is introduced #9260

Closed
kuworking opened this issue Sep 23, 2020 · 2 comments · Fixed by #9267
Closed

Formatting mdx, from v2.0.0 to v2.1.2 now a new line is introduced #9260

kuworking opened this issue Sep 23, 2020 · 2 comments · Fixed by #9267
Labels
lang:mdx Issues affecting the MDX extension to Markdown (not general Markdown issues) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program

Comments

@kuworking
Copy link

kuworking commented Sep 23, 2020

After upgrading Prettier from some version higher than 2.0.0, I see now that the formatting for a particular code has changed in mdx files

This code

# title

<Parenthesis>

CR: Carriage Return, \r
LF: Line Feed, \n

</Parenthesis>

was preserved by Prettier before (>2.0.0)

Now it gets an extra new line

# title

<Parenthesis>


CR: Carriage Return, \r
LF: Line Feed, \n

</Parenthesis>

My .prettierrc is this (prettier 2.1.2, eslint-config-prettier 6.11.0)

{
  "semi": false,
  "singleQuote": true,
  "trailingComma": "es5",
  "printWidth": 120,
  "arrowParens": "avoid"
}

How can I prevent this?

*Didn't inserted the playground because this code (changing <Parenthesis> for <div>) gives an error, but it should not)

EDIT:

I'm trying to downgrade Prettier, but somehow I can't see a consistent behavior

Going one by one to 2.0.3 has reverted the issue, then going upwards at 2.1.0 I had the correct behavior, and at 2.1.1 I had again the new extra line

But now I've downgraded directly to 2.0.0 and I see the same new line (but upgraded to 2.0.1 and I don't see it)

So I don't know what is happening (I'm using yarn)

Now I'm at 2.1.0 and I don't see the new line, so my bet is from 2.1.0 to 2.1.1 (https://github.com/prettier/prettier/blob/master/CHANGELOG.md#211)

@kuworking kuworking changed the title Formatting mdx, from v2.0.0 to v2.1.2 something has changed that now a new line is introduced Formatting mdx, from v2.1.0 to v2.1.1 now a new line is introduced Sep 23, 2020
@kuworking kuworking changed the title Formatting mdx, from v2.1.0 to v2.1.1 now a new line is introduced Formatting mdx, from v2.0.0 to v2.1.2 now a new line is introduced Sep 23, 2020
@fisker fisker 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 Sep 23, 2020
@fisker

This comment has been minimized.

@fisker
Copy link
Sponsor Member

fisker commented Sep 25, 2020

Introduced by #8825

@fisker fisker mentioned this issue Sep 25, 2020
4 tasks
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Dec 27, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2020
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) locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants