lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev dev.22 patch 1 - old Debian lynx bug #3846


From: Klaus Weide
Subject: lynx-dev dev.22 patch 1 - old Debian lynx bug #3846
Date: Sat, 17 Apr 1999 05:29:54 -0500 (CDT)

On Fri, 2 Apr 1999, Martin Schulze wrote:
> we have received the follwoing report through the bug tracking system
> of Debian at http://www.debian.org/Bugs/.
> 
> The bug is against version 2.4-FM-960316-1 but still present.
> The entire report can be viewed at 
> http://www.infodrom.north.de/Debian/Bugs/db/38/3846.html
> 
> Caveat: The URL as given in the bug report is not available anymore.
> 
> Please keep address@hidden in your replies in order
> to record it in that bug tracking system.
[.....]
> Antti-Juhani Kaijanaho wrote:
> > 
> > RFC 1866 (HTML 2.0) says:
> > 
> >    The content of a <DL> element is a sequence of <DT> elements and/or
> >    <DD> elements, usually in pairs. Multiple <DT> may be paired with a
> >    single <DD> element. Documents should not contain multiple
> >    consecutive <DD> elements.
> > 
> >    [...]
> > 
> >    Unless the COMPACT attribute is present, an HTML user agent may leave
> >    white space between successive DT, DD pairs. The COMPACT attribute
> >    may also reduce the width of the left-hand (DT) column.
> > 
> > Thus, it looks like a bug, since (by natural implication) space may be
> > left only between successive DT DD pairs, and multiple DT's are allowed
> > for a DD.  The newer HTML specifications do not address this.

It may be questionable whether this is a bug, but I agree that the
requested behavior makes more sense.  Below is a patch against current
2.8.2dev.22.  Not checked whether it applies cleanly against 2.8.1,
but if it doesn't the only reason would be insignificant formatting
changes, it should be trivial to fix by hand.

  Klaus

* Tweak in HTML_start_element case HTML_DT: prevent generation of empty
  line between multiple simple DT elements without intervening DD elements
  (Debian bug #3846).

--- lynx2-8-2.old/src/GridText.c        Tue Apr 13 04:39:16 1999
+++ lynx2-8-2/src/GridText.c    Sat Apr 17 05:00:48 1999
@@ -6473,6 +6473,15 @@
     return;
 }
 
+PUBLIC BOOL HText_inLineOne ARGS1(
+       HText *,        text)
+{
+    if (text) {
+       return text->in_line_1;
+    }
+    return YES;
+}
+
 /*
  *  This function is for removing the first of two
  *  successive blank lines.  It should be called after
--- lynx2-8-2.old/src/GridText.h        Tue Apr 13 04:39:16 1999
+++ lynx2-8-2/src/GridText.h    Sat Apr 17 05:02:19 1999
@@ -186,6 +186,7 @@
 extern int HText_LastLineSize PARAMS((HText *me, BOOL IgnoreSpaces));
 extern int HText_PreviousLineSize PARAMS((HText *me, BOOL IgnoreSpaces));
 extern void HText_NegateLineOne PARAMS((HText *text));
+extern BOOL HText_inLineOne PARAMS((HText *text));
 extern void HText_RemovePreviousLine PARAMS((HText *text));
 extern int HText_getCurrentColumn PARAMS((HText *text));
 extern int HText_getMaximumColumn PARAMS((HText *text));
--- lynx2-8-2.old/src/HTML.c    Tue Apr 13 04:39:16 1999
+++ lynx2-8-2/src/HTML.c        Sat Apr 17 04:56:35 1999
@@ -2281,7 +2281,23 @@
     case HTML_DT:
        CHECK_ID(HTML_GEN_ID);
        if (!me->style_change) {
+           BOOL in_line_1 = HText_inLineOne(me->text);
+           HTCoord saved_spaceBefore = me->sp->style->spaceBefore;
+           HTCoord saved_spaceAfter = me->sp->style->spaceAfter;
+           /*
+            *  If there are several DT elements and this is not the first,
+            *  and the preceding DT element's first (and normally only) line
+            *  has not yet been ended, suppress intervening blank line by
+            *  temporarily modifying the paragraph style in place.  Ugly
+            *  but there's ample precedence. - kw
+            */
+           if (in_line_1) {
+               me->sp->style->spaceBefore = 0; /* temporary change */
+               me->sp->style->spaceAfter = 0;  /* temporary change */
+           }
            HText_appendParagraph(me->text);
+           me->sp->style->spaceBefore = saved_spaceBefore; /* undo */
+           me->sp->style->spaceAfter = saved_spaceAfter; /* undo */
            me->in_word = NO;
            me->sp->style->alignment = HT_LEFT;
        }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]