I'm submitting a ... (check one with "x")
HTML tags are not finding closing tags for longer div blocks.
Successful compilation.
Compiling coolcats2 v0.1.0 (/Users/mahakal/Development/Apps/coolcats2/ui-src)
error: this open tag has no corresponding close tag
--> src/application/interfaces/follow.rs:170:13
|
170 | <div class="panel panel-default",>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If I remove some of the inner contents of the div block, the code will eventually compile, but of course this is missing part of the html then.
Can you post a minimal example?
This compiles:
https://gist.github.com/pythagorean/404414b5ae3f14de98a4f180dd1c60d0
By uncommenting the last inner div block, this does not compile, and gives the original error shown:
https://gist.github.com/pythagorean/9b75a25d26ef0d69af5ec470882dc6b7
I just tried this in one of my code, and it produces the same error:
html! {
<div id="buttons">
<div/>
</div>
}
```
error: this open tag has no corresponding close tag
--> src/lib.rs:264:17
|
264 |
~Indeed, the html! macro doesn't really consider / in tags:~
EDIT: Nevermind, it does:
https://github.com/DenisKolodin/yew/blob/a33a89f0f185a157b4440ad82eef66daf5f98896/crates/macro-impl/src/html_tree/html_tag/mod.rs#L162
I think that the problem is because HtmlTagOpen::peek/verify_end doesn't check for the div.
@pythagorean Can you try this PR and tell me if it fixes this issue? :slightly_smiling_face:
https://stackoverflow.com/a/3558200/2209243
Using self-closing div tags is invalid HTML5, so I closed my PR. You should use an empty pair instead (i.e. <div props="..."></div>).
@pythagorean Can you try this PR and tell me if it fixes this issue? 馃檪
Fixes.
JSX supports this, we should too. See here: https://reactjs.org/docs/jsx-in-depth.html