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

Supporting closed empty tags #2

Open
TheKnarf opened this issue Aug 3, 2018 · 1 comment
Open

Supporting closed empty tags #2

TheKnarf opened this issue Aug 3, 2018 · 1 comment
Labels
wontfix This will not be worked on

Comments

@TheKnarf
Copy link
Owner

TheKnarf commented Aug 3, 2018

Today all code gennerated using this library are full tags like <div></div>. When a tag don't have any content it should insted be a closed empty tag, like for <br/>.

If I add this feature it's important to note that some tags should always be an opening and closing tag. Like f.eks. <script> </script> (never <script/>).

@TheKnarf TheKnarf added the enhancement New feature or request label Aug 10, 2018
@TheKnarf
Copy link
Owner Author

TheKnarf commented Jul 5, 2019

The html5 standard has the following to say about "self closing tags":

Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.

That means I could check if the tag is in the set of void elements or foreign elements. But there might be very little to gain from this, in the case of void elements the "correct approach" is probably just to leave of the closing tag altogether. However we can't do that for isomorphic-jsx as I want it to be compatible with both HTML and XML.

What we perhaps could do is add an option to the library so that projects who use it can themself set the policy for "self closing tags". However for now I think we'll just leave the issue open until we find a usecase where it is needed.

@TheKnarf TheKnarf added wontfix This will not be worked on and removed enhancement New feature or request labels Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant