-
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
Pretter is replacing HTML markup in <svelte:head> when Formatting on Save #149
Comments
Could you please post the complete content of a |
Is it possible to post this code privately? Unfortunately I don't have permission from the client to share the codebase publicly. |
I’d only need a single file where the issue occurs. If you can strip it down to the minimum needed for it to happen, that’s great. Feel free to replace any text or code or whatever might be sensitive. |
We just need a minimum reproducible that is copy-pasteable, not the whole file or the whole project. |
Okay, the code I posted in the image above can reproduce the bug. Just save as .svelte file and paste it into VS Code. Press Alt(Option)+Shift+F to format or enable Format on Save in the settings. I just tested this. If you need more I can strip it down further but this alone appears to be enough to trigger the bug.
|
I can't reproduce the issue; the file formats fine for me (svelte extension 102.1.0). Weird. |
This is what my .prettierrc looks like. I wonder if it would make a difference?
|
There is a string of markup inserted by Prettier when I am attempting to save one of my Svelte components. I am running the following extensions:
Svelte for VS Code 102.1.0
Prettier - Code formatter 5.7.1
I also have the svelte.svelte-vscode selected in settings under Edtior: Default Formatter
Here is the original markup:
When I attempt to save using the built-in "Format on Save" option using the latest Svelte Tools and Prettier, the following markup is inserted:
The text was updated successfully, but these errors were encountered: