-
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
svelteSortOrder: 'none' deletes <style> tags unless followed by HTML comment. #472
Comments
Please provide a code example. If you use triple back tick (` repeated three times) you can paste whatever you want in there and it's preserved:
|
Just realized it is actually different (but worse?). Apparenty ALL style tags get erased (now that I have set Because also this:
Will be formatted to this:
But this:
...will persist. It doesn't matter if the style-tags contain code. This is how I found out, because after setting |
Btw, different issue, but the reason why I set My use case is: in long components, I would like to wrap my logic, markup, and style in those region-tags, so I can fold them away. But the very last #endregion tag (which has to be inside of a comment) would always be moved before the style-tags by svelte-prettier. Probably because it thinks that the comment is part of the markup, which is supposed to go before the style-tags. If you could change that behaviour - e.g. so that it ignores comments in the sort-order - I would gladly refrain from setting |
Thanks 👍🏼 |
I first realized this issue through this phenomenon:
If you add a #region tag after the markup, but don't add an #endregion tag after that, and you have a <style> tag at the end of the page, everything after the last HTML tag will be erased, including the style tag and any comment after the last HTML tag.
I was adding #region markers to my page-files, and all of my style-tags have disappeared from the pages.
This is fine:
But this:
Will be formatted to this:
Effectively erasing the styles. Happened to me on all of my pages.
The text was updated successfully, but these errors were encountered: