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

proposal: remove void element map in core and move responsibility to element function #124

Closed
SirMetathyst opened this issue Jan 3, 2023 · 2 comments

Comments

@SirMetathyst
Copy link

SirMetathyst commented Jan 3, 2023

Element functions are part of a separate package but the core has knowledge over tags and what tag is a void element which is strange to me. How about creating a new function VoidEl or adding an extra param to existing function before children? This way the element function itself can decide if it is a void element or not.

@markuswustenberg
Copy link
Member

Since the core package is all about writing HTML5, I think it's fine to have void element knowledge there. Everything in package html is just helpers. You could use just the gomponents package to write your HTML and be fine. Having a VoidEl would move the burden of deciding which HTML5 elements are void elements to the API user, and I'd rather have the library decide that for them.

(Thanks for all the feedback, even if I don't agree. 😊)

@SirMetathyst
Copy link
Author

SirMetathyst commented Jan 3, 2023

I understand your reasoning and acknowledge your point about burdening the user with deciding which HTML5 elements are void elements. Furthermore there are not many void elements anyway and the project is a html5 rendering package.

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