lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Incorrect centering


From: Chuck Martin
Subject: lynx-dev Incorrect centering
Date: Fri, 21 Mar 2003 09:02:19 -0500
User-agent: Mutt/1.4i

I would like to get some opinions from the more knowledgeable people on
this list regarding centering.  What should this do?:

<table align="center">
<tr>
<td>
I<br>
am<br>
not<br>
very<br>
happy<br>
acting<br>
pleased<br>
whenever<br>
prominent<br>
scientists<br>
overmagnify<br>
intellectual<br>
enlightenment<br>
</td>
</tr>
</table>

Most browsers render it like this:

                                  I
                                  am
                                  not
                                  very
                                  happy
                                  acting
                                  pleased
                                  whenever
                                  prominent
                                  scientists
                                  overmagnify
                                  intellectual
                                  enlightenment

but lynx renders it like this:

                                        I
                                        am
                                       not
                                       very
                                      happy
                                      acting
                                     pleased
                                     whenever
                                    prominent
                                    scientists
                                   overmagnify
                                   intellectual
                                  enlightenment

I believe lynx is wrong, because the 'align="center"' should apply to
the as a whole, and not to each line in every cell of the table, which
is what lynx does (for the sake of brevity, my example table only has
one cell, but in a larger table, every cell will have each line centered
when rendered by lynx, but not by other browsers).

The following patch will render it like this:

   I
   am
   not
   very
   happy
   acting
   pleased
   whenever
   prominent
   scientists
   overmagnify
   intellectual
   enlightenment

This still isn't correct, but considering the state of table handling in
lynx, I think it's more consistent, and more correct than the current way.
Note that this patch isn't the proper fix.  It merely disables the part
of the code that causes the incorrect (in my opinion) rendering.  I would
like to suggest that if the consensus is that I am correct, the disabled
code should be removed completely instead of disabled.  I have been running
lynx patched in this way for several years, and I think it makes text much
more readable this way in those cases where people incorrectly use tables
for formatting and attempt to center whole blocks of text or whole sections
of their web page in this way.  With an unpatched copy of lynx, all too
often, I see long sections of text with both margins ragged, and reading
text like this is irritating, to say the least.  Here is the patch:

--- HTML.c.orig 2002-10-17 02:25:54.000000000 -0400
+++ HTML.c      2002-08-20 00:19:22.000000000 -0400
@@ -5740,6 +5740,7 @@
            "HTML: ****** Maximum nesting of %d divisions/tables exceeded!\n",
                    MAX_NESTING));
        }
+#if 0
        if (present && present[HTML_TABLE_ALIGN] &&
            value[HTML_TABLE_ALIGN] && *value[HTML_TABLE_ALIGN]) {
            if (!strcasecomp(value[HTML_TABLE_ALIGN], "center")) {
@@ -5781,12 +5782,15 @@
                    stbl_align = HT_LEFT;
            }
        } else {
+#endif
            me->DivisionAlignments[me->Division_Level] = HT_LEFT;
            change_paragraph_style(me, styles[HTML_DLEFT]);
            UPDATE_STYLE;
            me->current_default_alignment = styles[HTML_DLEFT]->alignment;
            /* stbl_align remains HT_ALIGN_NONE */
+#if 0
        }
+#endif
        CHECK_ID(HTML_TABLE_ID);
        HText_startStblTABLE(me->text, stbl_align);
        break;


Chuck



; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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