Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yew-macro] Do not allow void elements to have children #1217

Merged
merged 2 commits into from
May 13, 2020
Merged

[yew-macro] Do not allow void elements to have children #1217

merged 2 commits into from
May 13, 2020

Conversation

kaoet
Copy link
Contributor

@kaoet kaoet commented May 12, 2020

Ensure HTML void element like
to be self-closed.

Fixes #1182

yew-macro/src/html_tree/html_tag/mod.rs Outdated Show resolved Hide resolved
yew-macro/src/html_tree/html_tag/mod.rs Outdated Show resolved Hide resolved
yew-macro/src/html_tree/html_tag/mod.rs Outdated Show resolved Hide resolved
Ensure HTML void element like <br> to be self-closed.
error: <br> tag must be self-closed
--> $DIR/html-tag-fail.rs:40:16
|
40 | html! { <br></br> };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fix this so that the compiler error message highlights the problematic tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to fix it by pointing out the opening tag. Is that what you want?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that looks better!

@jstarry jstarry merged commit d4276ce into yewstack:master May 13, 2020
@kaoet kaoet deleted the void-tag branch May 13, 2020 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yew-macro: Do not allow void elements to have children
3 participants