Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
An exception occurred when parsing an unclosed label using htm, but no error was reported.This leads to the wrong virtual dom object #122
Comments
|
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. |
|
@masx200 I’m not a contributor, but AFAIK htm doesn’t throw an error on parse errors because htm prioritizes size. |
|
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. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

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 !
[ "meta", { "name": "theme-color", "content": "#ffffff" }, { "type": "title", "props": null, "children": [ "masx200的github主页-首页" ] }, { "type": "script", "props": { "nomodule": "", "src": "https://cdn.jsdelivr.net/gh/masx200/webpack-react-vue-spa-awesome-config@2.4.0/lib/polyfill.min.js" }, "children": [] }, { "type": "link", "props": { "href": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/main.b9c7ffd191cff11a9b96.css", "rel": "stylesheet" }, "children": [ { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.6.c2cea2c684fac63ffae0.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.22.ca40a5fe169fbc33ccf0.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.0.1284ce7c8750a8cfed29.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.13.9d669a3554ec48651e33.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.14.64cca74158382392b422.js" }, "children": [] } ] } ]The correct output should look like this.
The correct output should look like this.
{ "type": "head", "props": null, "children": [ { "type": "meta", "props": { "charset": "utf-8" }, "children": [] }, { "type": "meta", "props": { "name": "viewport", "content": "width=device-width,initial-scale=1" }, "children": [] }, { "type": "meta", "props": { "name": "theme-color", "content": "#ffffff" }, "children": [] }, { "type": "title", "props": null, "children": [ "masx200的github主页-首页" ] }, { "type": "script", "props": { "nomodule": "", "src": "https://cdn.jsdelivr.net/gh/masx200/webpack-react-vue-spa-awesome-config@2.4.0/lib/polyfill.min.js" }, "children": [] }, { "type": "link", "props": { "href": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/main.b9c7ffd191cff11a9b96.css", "rel": "stylesheet" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.6.c2cea2c684fac63ffae0.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.22.ca40a5fe169fbc33ccf0.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.0.1284ce7c8750a8cfed29.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.13.9d669a3554ec48651e33.js" }, "children": [] }, { "type": "script", "props": { "charset": "utf-8", "src": "https://cdn.jsdelivr.net/gh/masx200/masx200.github.io@4.3.3/chunk.14.64cca74158382392b422.js" }, "children": [] } ] }