[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Gopher directory rendering problem
From: |
Thomas Dickey |
Subject: |
Re: [Lynx-dev] Gopher directory rendering problem |
Date: |
Sun, 16 Mar 2008 20:05:16 -0400 (EDT) |
On Sun, 16 Mar 2008, Thorsten Glaser wrote:
Thomas Dickey dixit:
thanks - it's been a while since I'd seen a live gopher site.
gopher://gopher.semmel.ch/ from Ventilator, an author on the german
news site http://symlink.ch/
Here's what happens: WWW/Library/Implementation/HTGopher.c creates an HTML
document in an internal stream, and puts most of it in a <PRE>...</PRE>.
GridText is not seeing the first newline (which would split the line)
since the logic in src/HTML.c for HTML_put_character() around line 350 for
the HTML_PRE case is not seeing the me->inPRE flag set.
case HTML_PRE: /* Formatted text */
/*
* We guarantee that the style is up-to-date in begin_litteral. But we
* still want to strip \r's.
*/
if (c != '\r' &&
!(c == '\n' && me->inLABEL && !me->inP) &&
!(c == '\n' && !me->inPRE)) { <-- this condition should pass
me->inP = TRUE;
me->inLABEL = FALSE;
HText_appendCharacter(me->text, c);
}
me->inPRE = TRUE;
break;
In turn, that is not set because of this chunk in src/HTML.c around line
2270:
case HTML_PRE: /* Formatted text */
/*
* Set our inPRE flag to FALSE so that a newline immediately following
* the PRE start tag will be ignored. HTML_put_character() will set it
* to TRUE when the first character within the PRE block is received.
* - FM
*/
me->inPRE = FALSE;
/* FALLTHRU */
Using that clue, I see that adding a PUT('\n'); in HTGopher.c after the
START(HTML_PRE) call passes in the "newline immediately following", which
sets the flag, making the newline seen as a place to split the line, etc.
The chunk in HTGopher.c looks like this now:
END(HTML_H1);
PUTC('\n');
START(HTML_PRE);
PUTC('\n'); <--- add this
while ((ich = NEXT_CHAR) != EOF) {
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net