Skip to content

Style tags that were not at top level were missing end attribute#5487

Merged
Conduitry merged 2 commits intosveltejs:masterfrom
ehrencrona:style-inside-head
Oct 2, 2020
Merged

Style tags that were not at top level were missing end attribute#5487
Conduitry merged 2 commits intosveltejs:masterfrom
ehrencrona:style-inside-head

Conversation

@ehrencrona
Copy link
Copy Markdown
Contributor

@ehrencrona ehrencrona commented Oct 2, 2020

If a style tag was not at the top level, the end property of it was empty. This is because the line element.end = parser.index; was missing for the style case in that changed code.

This fixes sveltejs/language-tools#586 and (very likely) fixes sveltejs/prettier-plugin-svelte#149

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

"children": [
{
"start": 13,
"end": 28,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before the code change, this was null

@Conduitry Conduitry merged commit aa759f4 into sveltejs:master Oct 2, 2020
@Conduitry
Copy link
Copy Markdown
Member

Good catch, thank you! And now also with less code

@Conduitry
Copy link
Copy Markdown
Member

This has been released, thank you!

taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style tag inside svelte:head marked as an error Pretter is replacing HTML markup in <svelte:head> when Formatting on Save

2 participants