-
Notifications
You must be signed in to change notification settings - Fork 25
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
[idea html6] empty end tags #15
Comments
How does it know which tag to close and in what order? |
Yikes, thats impossible to read. Can you use code blocks instead? |
I've been thinking about this for awhile, and wouldnt mind it being an option I guess, but HTML and XML were meant to be super readable. It's meant to be easy for humans to read, but still parseable by computers. For example: <f><bar><c><a></><foo></></></></> <f><c><a></a><foo></foo></c></bar></f> The one above takes me a minute to actually figure out where each end tag closes. Even on multiple lines it isn't as clear: <f>
<bar>
<c><a></><foo></></>
</>
</> <f>
<bar>
<c><a></a><foo></foo></c>
</bar>
</f> And 99% of HTML is not handcrafted. You may write a template, but the template will generate some markup, you may compress it, and even more commonly the tabbing will be all messed up from pulling in blocks of HTML from different. Something like: <f>
<bar>
<c>
<a>
</>
<foo></>
</>
</>
</> Make 30 lines of that and matching and counting tags is impossible. You still have to know you need a closing tag and you still need to know how many. Just saves a few characters of typing |
Well there's two ways to write code then:
and
If you write code the second way, you might prefer using empty tags. Additionally, if there ever arises a useful coding point to bring 2 or more sets of html together or closing something unknown off, this abstract structure may become useful. Let me see if I can find an example of someone using scripts because they needed to work around not having this (like closing off a block in C style coding). |
I just found http://www.oreillynet.com/xml/blog/2008/01/the_design_goals_of_xml_1.html When this idea came up, they considered it a question of clarity vs shortness for typists. Clarity always won in this battle when TBL was working on XML. I am not pushing an argument for the removal of closing tags. I believe the empty tag could be useful as a supplement in some way. https://en.wikipedia.org/wiki/Abstraction Further, abstraction. Removal of the concept of named from tag leaves the tag by itself. In this light </> could mean closing all tags. It could also mean closing the closest previous unclosed tag. Perhaps:
Adding a type attribute might offer some further control.
This would close all tags regardless of markup hierarchy. It could also be useful for ending control in XML trees. I suggest this be default. Perhaps everything after this is guaranteed unparsed.
This would close the first tag within a branch, thus closing all branches at the level.
This would close the previous tag. I suggest this not be default and to be used only when necessary. Requiring this clarity eliminates the point of poor unclear design.
Perhaps there could be uses for css and javascript. </ name="end"> Perhaps there could be a need to link to directly after a block. |
Personally I'd only use "empty end tags" to close elements that have no nested elements within. So for one-liners. |
Joel, would you use specifically:
There is a clarity issue with:
Also, I updated the original post to reflect this. |
The syntax doesn't change the fact that I'd implement "empty end tags" as one-liners.
Any use cases having to do with fixing gated code won't fly; get access and fix the problem upstream. |
Joel, I disagree. Also, this is not about gated code, this is about making some instances of dynamic code simpler. I agree if this were to be used by someone who was having an issue with gated code, that's doing it wrong. |
My opinion: |
I had another thought. Oscar, what are the new limits of m93a, what would type=" " actually do? |
|
m93a, I disagree on many levels now (but I used to agree with the logic). I'll re-explain and more:
|
1,2) For one-liners, as Joel said, its clear and easy to understand. Example:
|
m93a,
|
<a><b>something</a> equal to this: <a><b/>something</a> but in HTML6 it has changed to this <a><b>something</b></a> It would break old OMITTAG and programmer would have to use NESTC (self-closing tag) |
m93a, I am closing each namespace description. Now, I could use a typical layout if it's a static page if there is no need for further disambiguation, but then we're talking about html5 and I have no say so there. I updated it to reflect a pickle in html5. |
Just want to say it's really awesome to read your guys' comments about this stuff 😃 |
@philandy Ok but you could just use DOM createElement in your "dynamic" example. I think it would be even faster. |
@m93a: |
The "empty" closing tag allows for a strong level of abstraction. There are 3 different types right now. It allows strong control over unknown markup structures.
Generic pseudocode example:
Specific pseudocode example (problem existing in html5):
As you can see in the specific example, unless you add more scripting, there is no tag that can currently resolve the situation. This is where
</>
could come in. Discussion needs to take place regarding how this could work fluidly with the DOM tree (the type attribute I suggest may need to be replaced by a level or family attribute).If we focus on using the level attribute, there are 3 that DOS uses with directories:
</ level=".">
would represent the same level.</ level="..">
would represent the level above.</ level="\">
would represent all levels.I am unsure how to properly represent a family attribute. However, there may be something to being able to close siblings (or other same level tags) properly, such as browser incompatibilities or tags that function closed or opened but could play havoc on validators (and even worse, parsers).
Assuming for now we only work with the concept of levels, similar to DOS, levels below would have already been resolved because we have come back up somehow, such as you would have to close a div to be back in the body. Alternatively, there is no current tag that lets you traverse backwards within html to a lower level unless html6 works with the DOM API at some point and I don't foresee that happening.
The text was updated successfully, but these errors were encountered: