Quote mismatch

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
NetHawk
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Fri Sep 15, 2006 8:21 am
Contact:

Quote mismatch

Post by NetHawk » Tue May 24, 2016 9:25 am

Had this line in my code:

Code: Select all

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet">
(opening first Attribute and closing second with " which is obviously wrong).

The message I get is
The "link" element requires the "rel" or "itemprop" attribute, but not both. The "rel" attribute is used to specify the link's relationships or types, which is a set of space-separated keywords. This is an HTML5 requirement for creating a link.
The Parser was confused and so it took me a while to spot the error...

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Quote mismatch

Post by Albert Wiersch » Tue May 24, 2016 12:19 pm

This is an interesting problem. Unfortunately I don't think I can easily do anything about it because the attribute does equal a valid string.

CSE HTML Validator should have generated this warning message though, giving a clue as to the problem:
Using space characters in URLs may cause problems. If spaces must be used in URLs, then they should be encoded as "%20" (without the quotes). However, avoid spaces in URLs whenever possible and consider using the underscore character (_) instead of space characters in folder names and filenames.

Also, the link checker should detect a bad link caused by this error.

I'll keep this in mind though. If anything occurs to me how better address problems like this in way that can be "reasonably" implemented then I will certainly consider improving the validator messages when a problem like this is encountered.
Image
Albert Wiersch

NetHawk
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 5
Joined: Fri Sep 15, 2006 8:21 am
Contact:

Re: Quote mismatch

Post by NetHawk » Tue May 24, 2016 1:07 pm

That's right, the message continued with the "using space characters in URLs...". It should have given me a hint, but it didn't. Maybe, because I stopped reading, after the first hint. I didn't even bother to check the links tab, because the font was showing correctly, so I simply assumed a bug. But I'll be learning from this...

Post Reply