RE: Empty <div> tags

Ok, I modified CanPrune() in parser.c, adding the following before 'return
yes;'

    if (element->attributes != null)
        return no;

(sorry, I don't have cvs diff)
This seems to have done the job and it is not deleting my empty elements
with attributes. There doesn't seem to be any problems with this, but I
don't know the code well enough to know for sure.

Charlie

> -----Original Message-----
> From: Charles Reitzel [mailto:creitzel@rcn.com]
> Sent: Friday, December 13, 2002 3:07 PM
> To: html-tidy@w3.org
> Cc: Cox, Charlie; Bjorn Hohrmann
> Subject: RE: Empty <div> tags
> 
> 
> Thanks for your input.  Björn, can you weigh in on empty 
> elements with 
> attributes?  Are they prunable or no?
> 
> Also, I find it very curious that you can use a DIV to 
> position objects not 
> contained within.  Can you send a sample?  I like collect interesting 
> specimens of markup found "in the wild".
> 
> thanks,
> Charlie
> 
> At 01:57 PM 12/13/2002 -0500, Cox, Charlie wrote:
> 
> 
> > > -----Original Message-----
> > > From: Charles Reitzel [mailto:creitzel@rcn.com]
> > > Subject: Re: Empty <div> tags
> > >
> > >
> > > Hi Charlie,
> > >
> > > Adding an attribute should keep it from getting
> > > deleted, but it doesn't.  For example, Tidy will
> > > still drop the following:
> > >
> > > <div class="foo"></div>
> > >
> > > This would be a simple fix, but I'm not sure
> > > what the side effects would be.
> >
> >could you make an option that would be disabled by default?
> >
> > > Am I right in thinking that empty block
> > > elements with attributes should not be dropped?
> >
> >This is correct.
> >
> > > Also, out of curiosity, what kind of style is
> > > useful for an empty DIV?
> >
> >
> >we have about 500 forms that are converted from PDF and they 
> use the style 
> >attribute that defines border-top,border-left,top,left, and 
> width to draw 
> >lines duplicating the converted form.
> >
> >i.e.
> ><DIV
> >STYLE="position:absolute;top:168px;left:0px;width:729px;borde
> r-top-style:solid;border-top-width:1px;border-top-color:#00000
> 0;"></DIV>
> >
> >There can be hundreds of these per form.
> 

Received on Monday, 16 December 2002 11:58:50 UTC