ivi icon indicating copy to clipboard operation
ivi copied to clipboard

please add support for comments in template parser

Open leeoniya opened this issue 4 months ago • 4 comments

hey @localvoid 👋

Image

i don't need the html comment in the final output, but currently i cannot compile a template that includes a temporary comment like this.

leeoniya avatar Sep 09 '25 15:09 leeoniya

https://github.com/localvoid/ivi/blob/master/tests/compiler/module/data/19-comment/input.js

  • <!...> will be parsed as comment.
  • Expressions inside comments aren't supported.

localvoid avatar Sep 10 '25 03:09 localvoid

  • Expressions inside comments aren't supported.

heh, this kinda defeats the purpose of the original ask :)

is it not possible to support this by retaining any comment nodes containing expressions in the dom?

i guess this kinda works, though VSCode doesnt do this for me with Ctrl + / bindings (it adds an html comment node)

Image

this is a pretty good QoL that JSX has (with Ctrl + / bindings):

Image

leeoniya avatar Sep 10 '25 07:09 leeoniya

is it not possible to support this by retaining any comment nodes containing expressions in the dom?

It is possible to just ignore expressions in comments, I just overwhelmed with other tasks right now and don't have too much time to work on ivi. If you want to keep working on it, I can move it to a separate org on github and give you full access. I've migrated all projects that I currently maintain to a different UI library that is closed source right now.

localvoid avatar Sep 10 '25 08:09 localvoid

I just overwhelmed with other tasks right now and don't have too much time to work on ivi.

sorry to hear that! thanks for working on it for this long :)

If you want to keep working on it, I can move it to a separate org on github and give you full access.

maybe, i'll see if i can make some progress in a fork first. but i also have full time job (React stuff) and family, so this is side project for me as well.

I've migrated all projects that I currently maintain to a different UI library that is closed source right now.

interesting.

leeoniya avatar Sep 10 '25 08:09 leeoniya