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

Markdown: do not remove leading & trailing no-break whitespaces in inline code blocks #3755

Closed
maximbaz opened this issue Jan 17, 2018 · 4 comments · Fixed by #13590
Closed
Labels
lang:markdown Issues affecting Markdown priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency type:bug Issues identifying ugly output, or a defect in the program

Comments

@maximbaz
Copy link

maximbaz commented Jan 17, 2018

Prettier 1.10.2
Playground link

--parser markdown

Input:

preserve leading and trailing no-break whitespaces in inline code: `   hello   `

Output:

preserve leading and trailing no-break whitespaces in inline code: `hello`

Expected behavior:

preserve leading and trailing no-break whitespaces in inline code: `   hello   `
@maximbaz
Copy link
Author

Reported remarkjs/remark#321

@ikatyang ikatyang added type:bug Issues identifying ugly output, or a defect in the program scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency lang:markdown Issues affecting Markdown priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! labels Jan 17, 2018
@shreyasminocha
Copy link

It seems that remarkjs/remark#321 was closed with remarkjs/remark#424. However, I can still reproduce this issue with Prettier 2.0.0.

@sosukesuzuki
Copy link
Member

This case behave different between when reported and now.

Now(Current master):

First format:

Input:

preserve leading and trailing no-break whitespaces in inline code: `   hello   `

Output:

preserve leading and trailing no-break whitespaces in inline code: ` hello `

Second Format

Input:

preserve leading and trailing no-break whitespaces in inline code: ` hello `

Output:

preserve leading and trailing no-break whitespaces in inline code: `hello`

@thorn0 thorn0 linked a pull request Oct 13, 2022 that will close this issue
3 tasks
@thorn0
Copy link
Member

thorn0 commented Oct 14, 2022

Fixed by #13590 in next

@thorn0 thorn0 closed this as completed Oct 14, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:markdown Issues affecting Markdown priority:high Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent! scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency 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.

5 participants