Add support for HTML comments#84
Add support for HTML comments#84jviide merged 6 commits intodevelopit:masterfrom jviide:comment-support
Conversation
|
@jviide can we possibly adjust this PR a bit to support other types of unclosed tags, ideally customizable by consumer? (related issue #91 (comment)) That will be super-useful for consuming frameworks and should not add much size to the parser. import htm from 'htm'
// the dict of reserved single tags with (possibly) handlers?
htm.single = { '!--': true, '?xml': true, br: true, hr: true}
// the default is { '!--': true } |
|
@dy that would add quite a bit of size since currently the parser tags/tokens get inlined. In general, I don't want to do anything that takes |
|
Merged in the changes from the current master. The final size is 588 B (up from 563 B) for the regular build and 417 B (up from 394 B) for the mini build. |
This pull request adds support for HTML5-style comments (with relevant tests). Everything between comment delimiters
<!--and-->gets ignored during parsing. For example the the following template gets parsed ash("div", null):A deviation from the HTML5 standard is that the text between the delimiters can start with
>and->.The
.mjs.brsize grows from 540 to 564 bytes for the regular build. The mini version grows from 376 to 398 bytes.Closes #79.