-
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
Whitespace issue after a tag #159
Comments
I would say this is the correct behavior since the |
@dummdidumm I see, can you move the issue to prettier-plugin-svelte? |
The bug is: the text should "hug" the start/end tags and not add line breaks/whitespace. |
So the bug is that the second I'm a bit confused by the whitespace being present in the output after the body ("...coffee") but not before it ("buy me..."). I remember the Svelte parser doing trimming somewhere but I'm not sure in which circumstances. @dummdidumm let me know when the refactoring is done and if i can help at that point. I'll hold off until then. |
Oh right, I forgot about #28 . Prettier treats everything as whitespace sensitive except the block elements. Maybe we should do the same and switch it up. Right now everything is treated as a block except a specified list of inline-elements. |
Is there any progress on this issue? I am writing a lot of content right now which is wrongly formatted unfortunately, would be great to get this resolved. |
Fixes sveltejs#159 ### BREAKING CHANGE Components were treated as block elements before. Treat them as inline elements now (safer default behavior) by switching the logic: Everything that's part of the list of block elements is a inline element.
Fixes #159 ### BREAKING CHANGE Components were treated as block elements before. Treat them as inline elements now (safer default behavior) by switching the logic: Everything that's part of the list of block elements is a inline element.
Describe the bug
Might be related to prettier-plugin-svelte, but I am having this issue since a long time.
In the first example in the REPL provided below, there is no white space as expected, in the 2nd example the tag opening and closing tag and the text are all on individual lines (like prettier formats it) and it seems to count as a white space.
To Reproduce
https://svelte.dev/repl/6eca3f26aee1427580c9781c0e3396a5?version=3.29.4
Expected behavior
No white space no matter how the code is formatted.
Information about your Svelte project:
Your browser and the version: Brave 1.16.72
Your operating system: Ubuntu Linux 20.10
Svelte version: 3.29.4
Whether your project uses Webpack or Rollup
The text was updated successfully, but these errors were encountered: