This issue is not limited to PRE, nor is PRE the main application. There are numerous community Web sites that allow the users to submit hypertext content. You often get <I >italic </I ><B >bold</B > after you submit unless you use a zero-width non-joiner between them. While this is not strictly a HTML problem, allowing xml:space would allow a workaround for broken CMS.
Chris -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Hickson Sent: Monday, April 28, 2008 3:29 AM To: Henri Sivonen; liorean; Anne van Kesteren; Martin Atkins Cc: whatwg Subject: Re: [whatwg] xml:space I haven't done anything with xml:space. It doesn't do anything, and it's not an HTML5 thing, so as far as I can tell it is out of scope for HTML5. On Mon, 22 Jan 2007, Henri Sivonen wrote: > > > > Since this editor artifact is harmless in browsers and useful in > > editors, it would be nice if the spec made it conforming at least on > > the <pre> element in XHTML5. > > Suggested text: > > The xml:space attribute may be used on XHTML elements of XML documents. > Authors must not use the xml:space attribute in HTML documents. The > xml:space attribute, if present, must have the literal value "default" > or the literal value "preserve". The meaning of this attribute is > outside the scope of this specification. > > If that's too permissive, here's what would minimally cover my use case: > In XHTML (but not in HTML), the element pre may have the attribute > xml:space. If the attribute is present, the value of the attribute must > be "preserve". > > The first conforms to XML 1.0 for sure. The latter may not exactly, > depending on spec interpretation. I don't see why we should special-case this particular harmless non-HTML feature, and not any number of other harmless non-HTML features. If another specification wants to define something, then it's up to that specification to define when it can be used. On Tue, 23 Jan 2007, Martin Atkins wrote: > > Presumably its primary purpose is to act as a signal to generic XML > tools - that don't have any special knowledge about XHTML - that > they should not screw around with the whitespace inside PRE, etc. > > One obvious example of such a tool is an XML pretty-printer. While an > HTML pretty-printer like HTML Tidy can have rules "hard-coded" into it, > this is not true of a non-validating XML formatter unless it is > specifically written for XHTML. It seems that given the importance of XHTML, we can expect pretty printers to be written for it.
