Skip to content

svelteSortOrder: 'none' deletes <style> tags unless followed by HTML comment. #472

@andreasputlitz

Description

@andreasputlitz

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:

<!-- #region MARKUP --> <body></body> <!-- #endregion --> <!-- #region STYLES --> <style></style> <!-- #endregion --> 

But this:

<!-- #region MARKUP --> <body></body> <!-- #endregion --> <!-- #region STYLES --> <style></style> 

Will be formatted to this:

<!-- #region MARKUP --> <body></body> 

Effectively erasing the styles. Happened to me on all of my pages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions