Skip to content
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

🐛 BUG: ViewTransitions component breaks head tag on format #409

Closed
benediktms opened this issue Feb 25, 2024 · 1 comment
Closed

🐛 BUG: ViewTransitions component breaks head tag on format #409

benediktms opened this issue Feb 25, 2024 · 1 comment

Comments

@benediktms
Copy link

benediktms commented Feb 25, 2024

Describe the Bug

When adding the <ViewTransitions/> component to the head tag in a layout, formatting the file will break the the head and script tags if it is the last node in the head tag.

Before format:

<html lang="en">
  <head>
    // ...
    <ViewTransitions/>
  </head>

  <script is:inline>
    //...
  </script>

  //...
</html>

after format:

<html lang="en">
  <head>
    // ...
    <ViewTransitions/>
    <script is:inline>
      //...
    </script></head
>

  //...
</html>

moving the ViewTransition component further up (anywhere but last) the head tag make the formatter behave correctly.

<html lang="en">
  <head>
    // ...
    <ViewTransitions/>
    <title>foo</title>
  </head>

  <script is:inline>
    //...
  </script>

  //...
</html>

Steps to Reproduce

  1. npm init astro using any template
  2. create a layout
  3. add a head tag to the layout
  4. add a ViewTransisions component as the last element in the head tag
  5. format the file using prettier
  6. see the formatter break the head and script tag
@Princesseuh
Copy link
Member

Duplicate of #316

@Princesseuh Princesseuh marked this as a duplicate of #316 Feb 25, 2024
@Princesseuh Princesseuh closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
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

No branches or pull requests

2 participants