W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > January to March 1998

Re: Review of WD-WAI-HAG-19980123

From: Ian B. Jacobs <ij@w3.org>
Date: Fri, 30 Jan 1998 09:59:11 -0500
Message-ID: <34D1EABF.AE75A62@w3.org>
To: dd@w3.org
CC: w3c-wai-gl@w3.org
Daniel Dardailler wrote:
> 
> > JW:: Without re-reading the HTML specification on this point, I am under
> > the impression that any markup inside the PRE element (prior to the end
> > tag of PRE itself) is treated as part of the preformatted text rather than
> > as markup.
> 
> No it's OK, you can have CODE in PRE:
> 
> <!ENTITY % pre.exclusion "IMG|OBJECT|BIG|SMALL|SUB|SUP">
> 
> <!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
> <!ATTLIST PRE
>   %attrs;                              -- %coreattrs, %i18n, %events --


A better solution would be to separate the semantics
from the presentation by using the "white-space" property:

<STYLE type="text/css">
CODE.mylanguage { white-space: pre }
</STYLE>

<CODE class="mylanguage">
  BEGIN block
     for i in 1 to 10, do
     ...
     end for
  END block
</CODE>

However, this would only work for CSS-enabled browsers.

Ian

-- 
Ian Jacobs / 401 Second Ave. #19G / New York, NY 10010 USA
Tel/Fax: (212) 684-1814          Email: jacobs@w3.org
Received on Friday, 30 January 1998 10:00:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:46:57 GMT