- From: Richard A. O'Keefe <ok@atlas.otago.ac.nz>
- Date: Wed, 28 Jun 2000 12:42:32 +1200 (NZST)
- To: html-tidy@w3.org
I challenged the "slippery-slope" argument to which gjames replied: Less than a month ago, Michael Fitz wanted Tidy to leave his <A><DT><DD></A> and his <A><P><P></A> alone. Check the list archive, subject "Bug tydiing <A HREF...></A>". Ahem. <!ENTITY % font "TT|I|B |U|STRIKE|BIG|SMALL|SUB|SUP"> <!ENTITY % phrase "EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE"> <!ENTITY % special "A|IMG|APPLET|FONT|BASEFONT|BR|SCRIPT|MAP"> <!ENTITY % form "INPUT|SELECT|TEXTAREA"> <!ENTITY % text "#PCDATA|%font|%phrase|%special|%form"> <!ELEMENT A - - (%text)* -(A)> <DT>, <DD>, and <P> are NOT LEGAL inside an <A> element. I am asking that HTML Tidy should not change legal harmless HTML without explicit warrant. Michael Fitz's examples are blatantly illegal, and therefore irrelevant. How harmless is <!-- lots of --><B> THAT's what I call making a bold statement! <!-- lots of --></B> Pretty harmless. Look, we're *agreed* that HTML Tidy should at least report a warning pointing out that this is odd and not terribly pointful. Nobody is saying it should pretend it didn't notice anything! A message such as {file}:{line}:{column}:font element <{gi}> nested inside {file}:{line}:{column}:an outer <{gi}>, use -noidem to clean this up would make it clear that something odd is going on, what is odd, and what to do about it. Just because there's a chance there is a stylesheet rule selecting on bold text nested 208 levels deep doesn't mean it's a GOOD rule. There are better selectors to use than that, whether it is 208 levels deep or just 2 levels deep. I'd recommend using SPAN which is a truly presentationally neutral tag which would not be reduced and adjusting one's stylesheet selectors accordingly. Yes, but I'm talking about HTML that >I am not in charge of<. If I were generating this stuff, I would certainly change the generator. As such, I am completely in favor of reducing redundant nesting of presentational HTML tags. If there's a class or id attribute applied to some, I can see it being coerced (as Tidy calls it) to a SPAN (which will alert the user to adjust the stylesheet accordingly), but I've also seen software that generates useless id attributes on every tag (NetObjects Fusion) and would like the option to ignore them. Such an option would be nice. But again, it should default to the OFF state, because you can't *tell* which ID attributes are useless. One of the key points about CSS is that users can install their own style sheets which are not in or referenced by the document itself. One thing I would certainly like would be an option to erase all nonstandard attributes. If there is to be installed a switch on the reduction of redundantly nested tags, it is my opinion that it should default to the ON position with the note that there are better selectors to use than child-of-itself. Perhaps one of the next enhancements in stylesheet parsing should be to warn against such selectors on %fontstyle and %phrase markup, excluding BIG and SMALL which do have a cumulative effect. That would indeed be an enhancement for stylesheet parsing. Note that I am not defending <CODE><CODE>x</CODE></CODE> as good style, only as legal code. Lint-like warnings are a Good Thing. I could live with a switch with the wrong default as long as there _was_ a switch. There are other aspects of bad style that HTML Tidy could usefully do something about. For example, the same document that had nested <CODE> also had <H1>...</H1>...<H3>...</H3> with no intervening <H2>. That's legal, so in my view HTML Tidy was right not to change it, but it is not good style, so I wish HTML Tidy had said something about it.
Received on Tuesday, 27 June 2000 20:42:40 UTC