-
Notifications
You must be signed in to change notification settings - Fork 97
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
white space with line breaks is wrongly removed for html #143
Comments
A To fix:
To enhance:
|
Thanks! Tried out the master branch, it does keep one space between inline Essentially, the enhancement is to support
https://prettier.io/docs/en/options.html#html-whitespace-sensitivity Also, including a link to the prettier PR that introduced support for |
I'd say that's an unrelated issue. Prettier will break in these situations if there's a newline after the opening tag. So
formats to
whereas
formats to
And that's the behavior that accounts for the difference in formatting in the example given in the ticket. |
yeah, i see, you're right this particular issue, as @dummdidumm mentioned, has to do with recognizing The lack of this single enhancement is driving our team absolutely nuts - we had to completely remove prettier from our workflow. thank you both! really appreciate all the effort on fully supporting language tools for svelte. I can definitely see that it's not easy - so many edge cases to deal with. |
Goals: - switch logic around: prepare nodes before printing docs, try to avoid modifying printed result - respect user's wish to have line breaks sveltejs#143 sveltejs#117 - generally try to be more in line with how prettier formats things TODO: - either get tag break logic on par with prettier (breaking > into new lines etc) or adjust tests - more readable tag breaking logic for multiple children tags - tidy up
Goals: - switch logic around: prepare nodes before printing docs, try to avoid modifying printed result - respect user's wish to have line breaks: fixes #143, fixes #117, closes #121 - generally try to be more in line with how prettier formats things ### BREAKING CHANGE Tags are broken up differently now than before
Prettier normally doesn't inline markup like the one below but the svelte prettier plugin removes all white space
html markup should remain like so
but gets converted to this:
When using just prettier, or for other files types (e.g. html) everything works as expected.
If inlining should be the default, could an option be added, something like "presearchWhitespace" (there is one similar for svelte compiler)?
(using the latest vscode extension, prettier as well as prettier-plugin-svelte)
The text was updated successfully, but these errors were encountered: