Re: HTML 3.2: PRE should not exclude IMG

Gerald Oskoboiny wrote:
> 
> > 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.
> 

> 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.)

[ Snip ]

> 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

> 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/>.)


I remember replying to this argument... but perhaps it got lost
somewhere. I don't think this behaviour is well defined because
it's just an exception. In general, images are not the same size.
And if you allow <img> just because it can happen they are the same
size, what's the point of excluding <font>, <sub>, <sup>, <small>,
<big>? Just like in your example,
<pre>
a b <big>c</big> d
1 2 <big>3</big> 4
</pre>
will work. Similar examples can be made with <small>, <sub>, etc.

I really like to know if there's more reasoning behind the allowing
the <img> tag inside <pre> except that "it can happen it will work".
And if not, why will the font changing markup be excluded?




Abigail

Received on Friday, 31 May 1996 07:38:14 UTC