otsukare Thoughts after a day of work

Testing innerHTML for non breaking space

Imagine a document with non breaking space into it. How do you think it is represented into the browser innerHTML. We are using Live DOM Viewer to discover it. A document with 1 non breaking space type on the keyboard as such. On the macintosh, you hit option+space and it creates a non breaking space. Let's create a document and see it with Live DOM Viewer Webkit, Firefox returns  

<!DOCTYPE HTML><html><head></head><body><p>&nbsp;</p></body></html>

Opera represents it with the unicode character.

<!DOCTYPE HTML><html><head></head><body><p> </p></body></html>

The current HTML5 Editor Draft specification says that it should be escaped as  . I guess we should fix Opera here.