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

Warn users if <div> is not wrapping component html #342

Closed
liamlawless35 opened this issue Jan 24, 2022 · 3 comments
Closed

Warn users if <div> is not wrapping component html #342

liamlawless35 opened this issue Jan 24, 2022 · 3 comments
Assignees

Comments

@liamlawless35
Copy link

liamlawless35 commented Jan 24, 2022

I refactored some html code and broke my project due to the <div> tag not wrapping my html. Unicorn didn't throw any errors, nor did the browser. I was completely puzzled for ages. It could help other users down the line if this is implemented?

@adamghill
Copy link
Owner

This has happened to me before as well, so this would definitely be useful! It might be a little tricky because I use BeautifulSoup to parse the HTML in Python and it is very forgiving of invalid HTML (because usually that's what you want), but I might be able to figure out a way to provide more information to users.

@adamghill adamghill self-assigned this Jan 26, 2022
@adamghill
Copy link
Owner

This was a little trickier than I expected, but I do have some code that prints a warning when a component's HTML doesn't appear to be well formed in #351. I'm not sure if it should be on by default or if it will be noisy with false positives where the HTML would have been just fine.

Any thoughts on how aggressive Unicorn should be checking that component HTML looks valid?

@adamghill
Copy link
Owner

This will log a warning in the 0.42.0 release so I'm going to close this, but let me know what you think!

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

No branches or pull requests

2 participants