On 07/31/2015 07:06 PM, Dima Pasechnik wrote:
> 
> You don't need a closing tag that can be inserted by software, 
> as certainly is the case for \section or \item..
> (unless you spent a large part of your life writing HTML or XML by hand, 
> of course :-))
> 

The parser can insert them for you, but there are a lot of cases where
it's not at all clear *where* the closing tag should go. Often, the
presence of the opening tag is the bug -- not the absence of the closing
tag. In that case adding the closing tags just makes things worse.

Compare e.g. an XHTML 1.1 parser with an HTML5 parser. In XHTML, closing
tags are required, but in HTML they're not. Writing an XHTML parser is
simple -- any small XML parser will do -- but an HTML "parser" requires
lots of ugly logic.

I put "parser" in scare-quotes because you can't really parse HTML; you
have to "tag soup" it. Most of the additional crud in an HTML parser is
devoted to on-the-fly error handling (the user started a list item
within a table within a paragraph and didn't close anything?). If you
want to leave off your closing tags, in theory it's no problem -- once
you know the error handling rules, you know where the closing tag will
be added, and that's where it will go. But no one understands all of the
error-handling rules, so no one really knows what's going to happen when
they leave off a closing tag. It's very easy to trick people with short
examples.

So ultimately, it's just easier to spend some extra milliseconds putting
the closing tag where you know you want it. Otherwise, the first time
you have to debug a display issue twenty levels deep in some parser's
error-handling routine, you're going to find yourself in the red.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to