Open masx200 opened 5 years ago
htm is not html-compatible, it is jsx-compatible. See #91
In this case, htm you should first throw an error.
Yes, that's annoying feature of htm, stumbled upon that myself many times. <input>
, <img>
etc oftentimes come unclosed, and just copy-pasting html
to htm
breaks rendering silently.
@masx200 I’m not a contributor, but AFAIK htm doesn’t throw an error on parse errors because htm prioritizes size. (BTW, I don’t think there are lots of Chinese people here, Mandarin text reduces the readability of the text. If you would really like to provide a Chinese translation, please add it at the end of the issue)
Correct - developer ergonomic features like parse/tree errors should be implemented in an editor, not in a library paid for at runtime. I'd recommend using the lit-html plugin for VSCode.
In general, HTM 1 was better suited to the use-case described here, since it was built on top of the DOM's own HTML parser. You can find a similar solution for Preact (and likely React) in preact-markup.
An exception occurred when parsing an unclosed label using htm, but no error was reported.
This leads to the wrong virtual dom object.
An exception occurred when parsing an unclosed label with "htm", but no error was reported.
This resulted in the wrong "virtual dom" object.
The 'meta' and 'link' tags above are not closed
The 'meta' and 'link' tags above are not closed
An exception occurred !
The correct output should look like this.
The correct output should look like this.