Re: Empty paragraphs

Lee Passey wrote:
> 
> (2) in TrimSpaces(), no check is made for text nodes which have trimmed
> into oblivion.
> 
> I presume newer versions of tidy should include these fixes, so I am
> including here the diffs from the 8-2000 version that I used to
> accomplish this.
> 

I made a slight mistake here; the 8-2000 version of tidy _does_ delete
text nodes which have been trimmed into oblivion _if_ they are not
attached to a td or th node.  (I presume there are good reasons for
maintaining zero length text nodes for those tags, although for the life
of me I can't figure out what it would be).

In any case, here are the revised diffs for parser.c which fix the
mis-trimmed   entity.


289d288
<             /*!  NOTE:  &nbsp; is utf-8 encoded as two bytes  */
295,299d293
<                 if (   (unsigned char)(lexer->lexbuf[last->end - 1])
== 0xc2
<                     && c == 0xa0)
<                 {
<                     last->end -= 1;
<                 }
304,308d297
<                 if (   (unsigned char)(lexer->lexbuf[last->end - 1])
== 0xc2
<                     && c == 0xa0)
<                 {
<                     last->end -= 1;
<                 }
390d378
<     {
392,394d379
<         if (text->start == text->end)
<             TrimEmptyElement( lexer, text );
<     }
399d383
<     {
401d384
<     }

Received on Tuesday, 4 September 2001 11:11:22 UTC