Page 1 of 1

dup validation

PostPosted: Wed Nov 09, 2011 8:17 pm
by roedygr
<var><var>xxx</var></var>

Is not that serious an error, but it is redundant. You might optionally note any use of a nested element where the inner one did not do anything because it duplicated the outer.


<span class="a"><span class="b>xxx<span class="a">yyy</span></span></span> should not generate a warning. it must be a dup without anything intervening.

Re: dup validation

PostPosted: Wed Nov 09, 2011 10:00 pm
by Albert Wiersch
I could easily implement a check for "var" in another "var". I think that would be useful... the same for other elements like "samp". In most cases it probably wouldn't make sense to have a variable in a variable or sample output in sample output, but you never know.

What do you think of the above and should it be a warning or just a message? An error would probably be too strong.

Also, do you have any suggestions besides "var" and "samp"? Looks like "kbd" in "kbd" is useful (according to HTML5). Maybe "sup" and "sub" too but I'd have to do a little more research/thinking first. :D

Re: dup validation

PostPosted: Thu Nov 10, 2011 6:30 am
by roedygr
You should at least be able configure this off. It is not an error. The HTML will render fine. I have never experimented with <big><big>hamburger</big></big> to see if it supersizes.

There is a related problem I mentioned earlier
e.g.

<b><! -- just a comment --></b>

and <b></b>

and <span class="x"></span>

The <b><! -- macro Acronym SPCA --></b> can be legit since comments are often not really comments but SSI or some sort of macro that will later be expanded to real HTML. I would at least like to know about markup that does not appear to do anything. Much of my HTML is generated programmatically. Such a gaffe is often a symptom of deeper trouble.

This would be nice if you can implement it easily, but it is not on my biggies list. If I find myself making such errors I can find the common ones with regex searches. HTMLtidy has some ability in this direction. I use htmlidator, htmltidy and TopStyle. Each has finds problems the others do not.

Re: dup validation

PostPosted: Mon Nov 14, 2011 10:25 am
by Albert Wiersch
Thanks. I'll try to look into this and add some improvements for v11.01. In the mean time, if you have any specific examples of HTML patterns and what you'd like CSE HTML Validator to do/say about them, then please post them here as it would be helpful.

Re: dup validation

PostPosted: Tue Nov 22, 2011 10:28 pm
by roedygr
Albert Wiersch wrote:Thanks. I'll try to look into this and add some improvements for v11.01. In the mean time, if you have any specific examples of HTML patterns and what you'd like CSE HTML Validator to do/say about them, then please post them here as it would be helpful.


The errors I am most likely to make are:

<b><b>something</b></b> ditto em strong var

message: duplicate, unnecessary <br>

<span class="x"><span class="x>thin</span></span>

I means I hit the key to embed a style some kind twice.

message: duplicate, unnecessary <span

<span class="x"></span>

message: empty span

This is more serious. It means I probably put the span around some empty space instead of the thing I intended.

<span class="narrow"> </span>

is legit. A span may be controlling the width of the space.

for me <b><!-- macro Acronym URL --></b> is legit. Anything starting <!-- macro will expand later to text.

However <b><!-- top left block --></b> is an empty <b>

In the Compactor I permit a list regexes that describe the start of comments that later generate text. These can't be treated as ordinary comments.
see http://mindprod.com/products1.html#COMPACTOR

Re: dup validation

PostPosted: Fri Jun 08, 2012 1:09 pm
by Albert Wiersch
I've been thinking about this (for v12) and have added warnings for when elements like "var" and "samp" are nested within themselves. Currently just messages are generated for many elements because it's not really an error, but I think "var" and "samp" are more prone to be "errors" (or unintended) because of their semantics.

As for some other nesting, because of CSS, many of the constructs you might expect not to be proper could be intended, so I am hesitant to generate more warnings or errors.

For issues like "b" in "b" which currently generates a non-error, non-warning message, you could always upgrade that to an error if you'd like.

Does anyone have any more thoughts or suggestions about this?