[uf-dev] Proper use of value

Toby A Inkster mail at tobyinkster.co.uk
Tue Apr 22 11:01:28 PDT 2008


Brian Suda wrote:

> i can't give you a definitive answer, but i think and parse any
> class="value" and do NOT trim white-space, but i do collapse it. Value
> is something extra that the user adds, so i take the assumption they
> know what they are doing and that they meant to include that space. (i
> do think i reduce multiple spaces, tabs, returns to a single space - i
> need to confirm this)

For the record, the behaviour used by Cognition (or at least its  
intended behaviour - as I said, there is a bug in the latest released  
version pertaining to this issue) is:

* Within each element with class="value", expanses of white space are  
collapsed into single spaces.
* Within each element with class="value", white space is *not*  
trimmed from the beginning or end of the value (although it is  
collapsed as per above).
* All the elements with class="value" are then joined together  
without any interleaving white space to form a combined string.
* Within the combined string, expanses of white space are collapsed  
into single spaces.
* Within the combined string, white space *is* trimmed from the  
beginning and end.

In my experience, this seems to work well for the vast majority of  
real-world cases. (The percentage of pages that actually *use*  
multiple elements with class="value" for a single property is tiny  
anyway.)

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>





More information about the microformats-dev mailing list