popeindustries / lit-html-server

Render lit-html templates on the server as Node.js streams
MIT License
265 stars 12 forks source link

tagName is blank for tags with attributes #107

Closed AndersCan closed 4 years ago

AndersCan commented 4 years ago

The tagName is not set on a part element when adding attributes to a DOM element

<my-static-element>...</my-static-element> :heavy_check_mark: <my-static-element class="my-class">...</my-static-element> :x: <my-static-element >...</my-static-element> :x: (there is an extra whitespace)

I created a fork with a naive fix for these cases by reversing the tagName resolving.

I have not tried to fix the case when you have a dynamic property, but I've added a failing test for it

AndersCan commented 4 years ago

fixed in https://github.com/popeindustries/lit-html-server/pull/110