Sample output:

<ul class="facetapi-facet-im-62-field-stream" id="facetapi-facet-apachesolrsolr-block-im-62-field-stream">
<li class="leaf first"><a href="/search/site/summit?f[0]=im_62_field_stream%3A1335" class="facetapi-inactive">Employment (1)</a></li>
<li class="leaf"><a href="/search/site/summit?f[0]=im_62_field_stream%3A1338" class="facetapi-inactive">International (1)</a></li>
<li class="leaf last"><a href="/search/site/summit?f[0]=im_62_field_stream%3A1340" class="facetapi-inactive">Skills (1)</a></li>
</ul>

Sample error from http://html5.validator.nu/:

Error: Bad value /search/site/summit?f[0]=f[0]=im_62_field_stream%3A1335 for attribute href on element a: Illegal character in query component.

I had a quick look over the code, and couldn't find anything obvious. Apologies if this is actually a core issue. Note: this doesn't appear to be an issue for HTML4, or XHTML1 strict.

Comments

cpliakas’s picture

Status: Active » Closed (won't fix)

Hi daniel.nitsche.

Respectfully marking this as won't resolve, because the list is generated from the core theme_item_list() function. Therefore the underlying issue is in that function since it apparently doesn't handle some characters correctly. Also, the theme function is able to be overridden so you can adhere to whatever standard you need to. I am definitely in favor of HTML 5, but I am not sure it is Facet API's job to enforce it in the specific instance cited in the original post. In addition, I don't believe it is a requirement that D7 be HTML 5 compliant, although it would be a positive thing IMHO.

Thanks for posting,
Chris

daniel.nitsche’s picture

Thanks Chris, I figured as much but thought it was worth posting.

cpliakas’s picture

Absolutely worth posting, and thanks for bringing it up.

mariotux’s picture

I have the same problem, I am making a project who have to validate with w3c and the facetapi's blocks is a problem to do it. Do not exists a easy solution for do that...

Any ideas?

cpliakas’s picture

Yes. The solution is to override the theme function or make a new HTML5 compliant widget. Facet API is very extensible, so it would be a great contribution to make an HTML5 compliant widget if you wanted to do something that is repeatable by others.

dman’s picture

Not to open an old thread, but to add a cross-ref for searchers ...
It;s not the fault of Facet API, and certainly not of theme_item_list()
#1827854: W3C HTML5 Validation error with PHP array-based query-strings built with url() containing [ ] characters (eg views filters)

cpliakas’s picture

dman,

Thanks for the additional info! Definitely relevant.

Chris