[whatwg] Initial carriage return in <pre> and <textarea>

Henri Sivonen hsivonen at iki.fi
Fri Sep 11 04:30:33 PDT 2009

On Sep 11, 2009, at 11:39, Simon Pieters wrote:

> On Fri, 11 Sep 2009 10:12:59 +0200, Henri Sivonen <hsivonen at iki.fi>  
> wrote:
>> On Sep 10, 2009, at 23:40, Øistein E. Andersen wrote:
>>> § "Restrictions on content models" mentions that an  
>>> initial line feed (\n) character inside <pre> and <textarea> will  
>>> be removed.  Should it not cover carriage return (\r) and \r\n as  
>>> well?
>> If you put \r or \r\n in the source, you are expressing a \n. If  
>> you want to express a \r, you need to escape it, and then the tree  
>> builder doesn't zap it.
> &#xD; also ends up being \n in HTML, no?

Yes. Escaping \n doesn't make the tree builder preserve it.

Henri Sivonen
hsivonen at iki.fi

More information about the whatwg mailing list