choojs / nanohtml

:dragon: HTML template strings for the Browser with support for Server Side Rendering in Node.
MIT License
686 stars 49 forks source link

Svgs elements not created properly #151

Open isabellachen opened 5 years ago

isabellachen commented 5 years ago

If an svg element has multiple path tags inside, only the first path is added to the nano element.

If I have an svg element like this:

<svg>
  <title></title>
  <path></path>
  <path></path>
</svg>

When the element is rendered in the dom, I get this:

<svg>
  <title></title>
  <path></path>
</svg>
<path></path>

I did a comparison in codesandbox with creating a regular element with document.createElement and with nanohtml.

goto-bus-stop commented 5 years ago

Thanks for the report! This is a hyperx bug, probably the same as https://github.com/choojs/hyperx/issues/34 or https://github.com/choojs/hyperx/issues/41. Hard to say how hard the fix would be.

mreinstein commented 3 years ago

After some investigation, the issue that is causing this problem is https://github.com/choojs/hyperx/issues/41 I've added details in that issue about exactly what is happening, and a possible solution we might apply.