-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
html!: allow mixing self-closing and non-sc tags
Self-closing tags are more convenient when there are no children. For instance, React's JSX allows it. Before, self-closing tags where considered as open tags in `verify_end`, causing codes like this to not compile: ```rust html! { <div> <div/> // <- considered as open tag </div> } ``` ``` error: this open tag has no corresponding close tag --> src/lib.rs:264:17 | ... | <div> | ^^^^^ ``` Add a new `Peek`-able `HtmlSelfClosingTag`, used in `verify_end`. However, this fix isn't ideal because it peeks the buffer twice for non self-closing tags. I did it that way in order to keep the peek thing. An alternative would be to turn HtmlSelfClosingTag::peek into a function returning (ident, is_self_closing). Fixes: #522
- Loading branch information
1 parent
a33a89f
commit 59e90a9
Showing
2 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters