HTML 3.2: PRE should not exclude IMG

This comment is based on the "Tuesday 30-May-96" version of the Wilbur DTD.

On Jan 9, 1996, in <96Jan9.232901-0700_mst.138878-3+92@amisk.cs.ualberta.ca>,
I asked why you can't have IMG's within PRE-formatted text in HTML 2.0:

> Much to my chagrin, it turns out that it's invalid to use <IMG> inside
> <PRE> in HTML 2.0. Is there some reason for this? (I guess I'm not asking
> if there's some reason it's like this in HTML 2.0, but rather is there
> some reason it "should" be this way in HTML?)

to which Dan Connolly replied:

> No -- no good reason, anyway. I think this was on the "to-do" list
> during the HTML 2.0 review, and I just forgot to do it. I was surprised
> myself when I went back and realized this change never got made.

Me:

> Would it be possible to get this changed for the next version of HTML?

Dan:

> Yes.


So, could this be changed in the HTML 3.2 DTD? (and Cougar as well?)

I think all that needs to be changed is %pre.exclusion, which should be:

    <!ENTITY % pre.exclusion "BIG|SMALL|SUB|SUP|FONT">

(This subject came up again more recently on www-html; attached is my most
recent message on the subject, which nobody disagreed with.)

Gerald

---------------------------------------------------------------------------
Subject: Re: IMG in PRE? -Reply
From:	Gerald Oskoboiny <gerald@cs.ualberta.ca>
To:	www-html@w3.org
Date:	Mon, 13 May 1996 13:31:32 -0600 (MDT)
Message-Id: <96May13.133344-0600_mdt.138914-4+35@amisk.cs.ualberta.ca>


Charles Peyton Taylor writes:

> >>> Keith Instone <instone@cs.bgsu.edu> 05/12/96 09:57am >>>
> >With HTML 3.2 being ironed out, is it time to allow IMG in PRE?
> >I read the discussion on www-html from back in January on this
> >topic and still do not see a good reason to exclude IMG from
> >within PRE.
> 
> I remember this conversation, and I remember Abigail 
> pointing out what was wrong with it.

I brought this up in January, and I believe I answered all concerns
raised at the time.

In short:

   - it's current practice (this is used all over the place to align stuff
     without using tables; for an example, see http://sunsite.unc.edu/ ),

   - it's extremely useful (http://ugweb.cs.ualberta.ca/~gerald/validate/),

   - it "works" with every browser that I know of.

This should be enough to make it standardized behavior.

Below is my reply to Abigail's concerns; a selective archive of the
thread is also available at:

   http://ugweb.cs.ualberta.ca/~gerald/validate/img-in-pre.html

Gerald

Subject: Re: Why no <IMG> inside <PRE>?
From:   Gerald Oskoboiny <gerald@cs.ualberta.ca>
To:     www-html@w3.org
Date:   Wed, 10 Jan 1996 10:06:13 -0700 (MST)
Message-Id: <96Jan10.100830-0700_mst.138884-3+20@amisk.cs.ualberta.ca>


Abigail writes:

> Daniel W. Connolly wrote:
> ++
> ++ Gerald Oskoboiny writes:
> ++ >Much to my chagrin, it turns out that it's invalid to use <IMG> inside
> ++ ><PRE> in HTML 2.0. Is there some reason for this? (I guess I'm not asking
> ++ >if there's some reason it's like this in HTML 2.0, but rather is there
> ++ >some reason it "should" be this way in HTML?)
> ++
> ++ No -- no good reason, anyway. I think this was on the "to-do" list
> ++ during the HTML 2.0 review, and I just forgot to do it. I was surprised
> ++ myself when I went back and realized this change never got made.
>
> Hmm, I always thought it was because the unit in <PRE> is characters,
> and the unit of images is pixels. If I have:
>
> <pre>
> a b <img src = "foo.gif" alt = "xxx"> d
> 1 2 3 4
> </pre>
>
> to which should the 4 (vertically) align?

I guess that would be "undefined", but, if you have:

  <pre>
  a b <img src = "foo.gif" alt = "xxx"> d
  1 2 <img src = "bar.gif" alt = "yyy"> 4
  </pre>

and "foo.gif" is exactly as wide as "bar.gif", the behavior is well-defined,
and extremely useful. (as in, for instance, <URL:http://sunsite.unc.edu/>.)

Gerald
p.s. anyone know why this is being echoed on www-talk?
--
Gerald Oskoboiny  <gerald@cs.ualberta.ca>  http://ugweb.cs.ualberta.ca/~gerald/
---------------------------------------------------------------------------


-- 
Gerald Oskoboiny <gerald.oskoboiny@ualberta.ca>      Phone: +1-403-492-7698
Systems Analyst, Information Systems                   Fax: +1-403-492-7172
Office of the Registrar and Student Awards            University of Alberta
<URL:http://www.registrar.ualberta.ca/>       <URL:http://www.ualberta.ca/>

Received on Thursday, 30 May 1996 23:59:09 UTC