Re: [ROOT] Bug in THtml

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Mon Jul 08 2002 - 13:48:50 MEST


Hi Axel, Francois-Xavier, and others, 

Just a short note on this.  

On Sat, 06 Jul 2002 08:55:51 +0200
axel@fnal.gov wrote
concerning "Re: [ROOT] Bug in THtml":
> Hi,
> 
> * <pre> tags within Begin_html and End_html are ignored as THtml 
> generates enclosing pre tags for documentation found in sources / 
> headers automatically. If THtml would allow additional contained pre 
> layers some browsers can't display the page properly anymore. I will 
> add a little bit of brain to THtml to allow it to see if there's 
> another layer of pres opened (in which case the pre /pre tags are 
> removed) or if the Begin/End_html's pres are closed (in which case 
> they'll make it into the html output).

I believe that '<pre>' does not allow nested '<pre>', and so the
browsers that does not render the page correctly are doing The Right
Thing(tm) - that is being standard compliant.  I tried the following
fragment on W3C HTML validator [1], and indeed, it doesn't check: 
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <HTML>
      <HEAD>
        <META HTTP-EQUIV="Content-Type" 
              CONTENT="text/html; charset=ISO-8859-1">
        <TITLE>A test of nested PRE's</TITLE>
      </HEAD>
      <BODY>
        <PRE> 
          Hello World
          <PRE>
            FUBAR 
          </PRE>
        </PRE>
      </BODY>
    </HTML>


Of course, one can work with the (shady) knowledge that THtml outputs
'<pre>' tags, and do something like 
 
    // don't make lines like this extend column 70 - it makes the code
    // easier to read 
    //____________________________________________________________________
    /*Begin_Html 
    </pre> 
      This text is rendered with superflous white-space removed.  We
      can put in a 
    <pre>
      &lt;PRE&gt; element here, if we need that. 
    </pre>
    However, it's impartive that we start a new <tt>&lt;PRE&gt;</tt>
    element before leaving this bleck, so the rest of the page comes
    out alright.  You should <strong>always</string> 
    <a href="http://validator.w3.org/check/referer">check</a> your
    HTML code for validity, so that you're sure that all (conforming)
    browsers will render you code correctly. 
    <PRE>
    */End_Html  
    

Yours, 

 ____ |  Christian Holm Christensen 
  |_| |	 -------------------------------------------------------------
    | |	 Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|	          DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|	          Denmark                    Office: (+45) 353  25 305
 ____|	 Email:   cholm@nbi.dk               Web:    www.nbi.dk/~cholm
 | |


[1] http://validator.w3.org/



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:59 MET