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

Self closing components #112

Open
yoannes opened this issue Feb 22, 2023 · 3 comments
Open

Self closing components #112

yoannes opened this issue Feb 22, 2023 · 3 comments

Comments

@yoannes
Copy link
Contributor

yoannes commented Feb 22, 2023

Is your feature request related to a problem? Please describe.
It would be nice if we could use self closing components:

Describe the solution you'd like

<iframe />

Additional context
In the current version (1.1.11) nothing gets rendered after the component

@mantaroh
Copy link
Collaborator

Thanks!

I looked into this spec(i.e., Self-closing tag). It seems to me that the custom element should have a closing tag:
https://usefulangle.com/post/363/custom-element-valid-name

But I could not find the official specifications. (W3C / WHAT-WG)

I guess major browsers will inject closing-tag automatically on their HTML parser. (I tried this phenomenon using by non-closing

tag. <div><p/></div> should be <div>< p></p></div> automatically)

In spear case, a parser is node-html-parser, So spear is dependent on this library.

If we support self-closing components, we should implement the pre-convert process, like auto closing-tag injection.

@yoannes
Copy link
Contributor Author

yoannes commented Mar 2, 2023

our parser can't handle it, so I think its ok to leave as it is for now. Its no problem, just small details for the person who is used to frameworks

@mantaroh
Copy link
Collaborator

We can parse it if we have preprocess which injecting close tag.

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