Re: Serialize U+00A0 as   in HTML? (detailed review of Serializing HTML fragments)

On Mon, 27 Aug 2007 18:40:49 +0200, Julian Reschke <julian.reschke@gmx.de>  
wrote:

>
> Simon Pieters wrote:
>>  (This is part of my detailed review of the Serializing HTML fragments  
>> section.)
>>  IE7 and Firefox serialize U+00A0 characters in data and attribute  
>> values as "&nbsp;" when getting innerHTML. Safari and Opera don't.  
>> Should the spec be aligned with IE7 and Firefox here?
>>      
>> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cscript%3Ewindow.onload%3Dfunction%28%29%7Bw%28document.body.innerHTML%29%7D%3C/script%3E%3Cp%20title%3D%22x%A0x%22%3Ex%A0x
>
> Why would it matter, as long as the serialization is valid?

I'm not sure which definition of the word "valid" you're using here. (The  
serializing algorithm does not ensure that the output is valid HTML, or  
even that it will parse into the original DOM when parsed.)

Anyway, serializing as &nbsp; is probably nicer for copy and paste, since  
otherwise non-breaking spaces are generally converted to normal spaces.

-- 
Simon Pieters
Opera Software

Received on Monday, 27 August 2007 17:04:21 UTC