dy / xhtm

XHTM − eXtended Hyperscript Tagged Markup
MIT License
25 stars 2 forks source link

Initial comment in html string causes following tags to not get rendered #16

Closed aral closed 1 year ago

aral commented 1 year ago

Reproduction

const html = xhtm.bind(vhtml)

const markup = html`
  <!-- A comment -->
  <h1>This is not rendered</h1>
  <p>Neither is this.</p>

  <!-- Another comment -->
  <h2>However, this is rendered correctly.</h2>
`
console.log(markup)

Output

<h2>However, this is rendered correctly.</h2>

Also: is the expected behaviour that HTML comments are stripped from the output or remain in the output? (My personal preference would be that they remain in the output but it’s not a showstopper either way.)

dy commented 1 year ago

Fixed in 1.5.12, thanks. I don't think there's a way to represent comments in JSX, since xhtml mainly targets that.

aral commented 1 year ago

Thank you :)

PS. I couldn’t find you on the fediverse, so here’s a link to my announcement today about moving to xhtm in Kitten: https://mastodon.ar.al/@aral/109936742345154567 :)

dy commented 1 year ago

Thanks :) I'm not yet on mastodon. Maybe I'll need to transition one day. Gotta get some stimulus I suppose.