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

renderToString is returning document tags within the <template> output when only rendering a fragment #40

Closed
thescientist13 opened this issue May 28, 2022 · 0 comments · Fixed by #41
Assignees
Labels
0.2.1 bug Something isn't working

Comments

@thescientist13
Copy link
Member

Type of Change

  • Bug

Summary

After upgrading to 0.2.0, saw that when using renderToString, <html> and <head> tags are now coming back in the rendered HTML.

Seems like a regression due to #30 .

Details

Before

<wc-footer>
   <template shadowroot="open">

      <style>
        :host {
          color: var(--color-accent);
          bottom: 0;
          width: 100%;
          min-height: 30px;
          padding-top: 10px;
          text-align: center;
        }
    
        footer {
          background-color: #192a27;
        }
      </style>
    
      <footer>
        <span>© 2022</span>
      </footer>

  </template>
</wc-footer>

After

<wc-footer>
   <html><head><template shadowroot="open">

    <style>
      :host {
        color: var(--color-accent);
        bottom: 0;
        width: 100%;
        min-height: 30px;
        padding-top: 10px;
        text-align: center;
      }
  
      footer {
        background-color: #192a27;
      }
    </style>
  
    <footer>
      <span>© 2022</span>
    </footer>

  </template></head><body></body></html>
</wc-footer>

Also seems like we are missing the closing > as well. I bet JSDOM probably normalized this again, so should really get #14 in place.

@thescientist13 thescientist13 added the bug Something isn't working label May 28, 2022
@thescientist13 thescientist13 added this to the Proof of Concept milestone May 28, 2022
@thescientist13 thescientist13 self-assigned this May 28, 2022
@thescientist13 thescientist13 changed the title renderToString is returning document tags within the <template> output renderToString is returning document tags within the <template> output when only rendering a fragment May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2.1 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant