Mild annoyance

For topics about current or future BETA releases, including feature requests.

Mild annoyance

Postby DavidHyde » Fri Apr 02, 2010 6:05 pm

Albert,
Nicely done, once again. The only minor irritant I noticed after validating 40+ pages was

"[118] The text content of the "a" element begins with whitespace. While technically allowable, this whitespace may not be wanted."

which results from the link text appearing on a separate line (preceded by <tab>s in my case, but not sure if that is relevant) from the leading a tag. I got this warning on every page, mostly because I build all the pages from a template that has this "feature". This warning doesn't come up in the previous versions I've used and really... I can't see anything even remotely wrong with what I'm doing or how the "unwanted" white space could ever be displayed in the rendered page.

If there's a way to turn off this one specific warning w/o turning off all other warnings... I don't see it. I definitely don't want to turn off ALL warnings as they generally give useful information.
DavidHyde
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 3
Joined: Fri Apr 02, 2010 5:53 pm

Re: Mild annoyance

Postby Albert Wiersch » Fri Apr 02, 2010 9:30 pm

Hi David,

Sure, you can disable that message.

The easiest way would be to right-click on it and disable flag 118, which is what the [118] means at the beginning of the message. That will also disable the whitespace checking for the title content as well (you can check the documentation for what flag 118 controls). Here is what it says:
Checks for preceding and trailing whitespace characters of the text content of certain elements like "a" and "title".


Here is more information about disabling messages:
http://www.htmlvalidator.com/htmlval/v9 ... ssages.htm

In the new BETA, you can also disable messages by on exact text match, so the message is only disabled if it exactly matches. If you disable it in that way, then it won't also disable the title content checking because that message would be different - it would mention the "title" element instead of the "a" element.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Mild annoyance

Postby DavidHyde » Fri Apr 02, 2010 9:51 pm

Thanks, that did the trick nicely.
DavidHyde
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 3
Joined: Fri Apr 02, 2010 5:53 pm

Re: Mild annoyance

Postby nreiter » Sat Apr 03, 2010 8:25 am

I also got that white space message on several a tags but there was no white space in the text.

Example:

<a title="Web Analytics" href="http://getclicky.com/xxxxx">

This line had error 118 yet there is no white space at the start of the text.
nreiter
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Fri Apr 02, 2010 12:25 pm

Re: Mild annoyance

Postby Albert Wiersch » Sat Apr 03, 2010 9:17 am

nreiter wrote:I also got that white space message on several a tags but there was no white space in the text.

Example:

<a title="Web Analytics" href="http://getclicky.com/xxxxx">

This line had error 118 yet there is no white space at the start of the text.


What was between the "a" start tag and its matching end tag (I only see the start tag)? Can you post a piece of HTML that reproduces this problem? Thanks.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Mild annoyance

Postby nreiter » Sat Apr 03, 2010 10:11 am

Sorry, I missed the second line of code. Here's the complete a tag:

<a title="Web Analytics" href="http://getclicky.com/xxxxx">
<img alt="Web Analytics" src="http://static.getclicky.com/media/links/badge.gif" border="0" /></a>

I think I found the problem. The a tag was split into 2 lines with a CRLF. When I combined them, the error went away.

<a title="Web Analytics" href="http://getclicky.com/20862"><img alt="Web Analytics" src="http://static.getclicky.com/media/links/badge.gif" border="0" /></a>

Is splitting the tag into multiple lines really an error?
nreiter
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Fri Apr 02, 2010 12:25 pm

Re: Mild annoyance

Postby Albert Wiersch » Sat Apr 03, 2010 12:03 pm

nreiter wrote:I think I found the problem. The a tag was split into 2 lines with a CRLF. When I combined them, the error went away.


That would do it. The CRLF is considered (causes) whitespace.

nreiter wrote:Is splitting the tag into multiple lines really an error?


Technically this issue is not a problem but CSE HTML Validator throws a warning because it's not usually what is wanted. The message can easily be disabled if the author doesn't want to see those warnings.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Mild annoyance

Postby nreiter » Sat Apr 03, 2010 12:23 pm

What confused me was the error message reference to "text content" which implied, to me, inside the quotes. As there was none, I couldn't understand why the error was coming up.

I thought white space was just ignored in HTML unless it was in a character string (between quotes). My HTML knowledge is still minimal, but I'm learning :)
nreiter
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Fri Apr 02, 2010 12:25 pm

Re: Mild annoyance

Postby Albert Wiersch » Sat Apr 03, 2010 1:21 pm

nreiter wrote:What confused me was the error message reference to "text content" which implied, to me, inside the quotes. As there was none, I couldn't understand why the error was coming up.


I see... would "link text" have been more clear (instead of "text content")?

nreiter wrote:I thought white space was just ignored in HTML unless it was in a character string (between quotes). My HTML knowledge is still minimal, but I'm learning :)


What you're probably thinking of is a string of multiple whitespace characters. They are often "condensed/compressed" into one whitespace character.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Mild annoyance

Postby nreiter » Sat Apr 03, 2010 1:49 pm

Yes, "link text" might be a better choice of words.

I'll have to refresh myself on whitespace handling in HTML. But now I know what the 118 message means so I know what to look for.

I'm awaiting a reply to my later message as that is a bigger problem. So far, the Validator has shown me that my HTML needs a lot of cleaning up. I knew that but was ignoring it before :) Now I have the tools and no excuse.
nreiter
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Fri Apr 02, 2010 12:25 pm

Re: Mild annoyance

Postby Albert Wiersch » Mon Apr 05, 2010 10:21 am

nreiter wrote:Yes, "link text" might be a better choice of words.


Thanks. I've changed the message to use "link text" when talking about the text content of "a" tags.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Mild annoyance

Postby nreiter » Mon Apr 05, 2010 10:44 am

Or see why the warning is coming up when there is actually no white space in the text.
nreiter
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Fri Apr 02, 2010 12:25 pm

Re: Mild annoyance

Postby Albert Wiersch » Mon Apr 05, 2010 10:46 am

nreiter wrote:Or see why the warning is coming up when there is actually no white space in the text.


Is this warning coming up when there is no whitespace in the text? If so, then can you provide sample HTML that reproduces this problem? Thanks!
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2361
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: Mild annoyance

Postby nreiter » Mon Apr 05, 2010 11:49 am

I just looked again and the lines were split with CRs again. Sorry, false alarm :)
nreiter
Rank I - Novice
Rank I - Novice
 
Posts: 10
Joined: Fri Apr 02, 2010 12:25 pm


Return to CSE BETA Talk

Who is online

Users browsing this forum: No registered users and 1 guest

cron