Reputation: 128
I'm running some code for a webpage through the W3 HTML5 validator and am getting the following error:
3 Line 29 Column 346: Bad value Iinterior-lighting?f[O]field_design_style%3A169
for attribute href on element a: Illegal character in query:
not a URL code point.
..tapi-inactive id=facetapi-link--151>Unspecified (80)<span c].ass=”element-in...
The > tag closing the is the one that is causing the error. Here is the full line of code that is causing the error.
<div class="item-list"><ul class="facetapi-facetapi-checkbox-links facetapi-facet-field-design-style" id="facetapi-facet-search-apisearch-api-solr-index-block-field-design-style"><li class="leaf first"><a href="/interior-lighting?f[0]=field_design_style%3A169" rel="nofollow" class="facetapi-checkbox facetapi-inactive" id="facetapi-link--139">Unspecified (80)<span class="element-invisible"> Apply Unspecified filter </span></a></li>
Once again the thing that is causing the error is the > in the opening tag.
This looks right to me and I think it might just be an error with the validator. There are 175 errors just like it on this page.
Thanks
Upvotes: 1
Views: 49
Reputation: 1372
According to the RFC 3986,
A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax.
So you should encode square brackets in the url.
(Shamelessly stealed from this answer)
Upvotes: 2