diff -urN w3m-0.1.10/file.c w3m-0.1.10-fix/file.c
--- w3m-0.1.10/file.c Tue Jun 6 14:54:35 2000
+++ w3m-0.1.10-fix/file.c Sun Jun 11 06:41:05 2000
@@ -2135,7 +2135,7 @@
if (cur_status != R_ST_NORMAL ||
prev_status != R_ST_NORMAL)
continue;
- if (!Strncasecmp_charp(tmp, "ptr[0] == '<' && Strlastchar(tmp) == '>') {
@@ -2509,6 +2509,16 @@
Str id = NULL;
#endif /* ID_EXT */
+ if (obuf->flag & RB_PRE) {
+ switch (cmd) {
+ case HTML_NOBR:
+ case HTML_N_NOBR:
+ case HTML_PRE_INT:
+ case HTML_N_PRE_INT:
+ return 1;
+ }
+ }
+
switch (cmd) {
case HTML_B:
obuf->in_bold++;
@@ -2591,6 +2601,11 @@
case HTML_OL:
case HTML_BLQ:
CLOSE_P;
+ if (!(obuf->flag & RB_IGNORE_P)) {
+ flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
+ if (!(obuf->flag & RB_PREMODE) && h_env->envc == 0)
+ do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
+ }
PUSH_ENV(cmd);
#ifndef ID_EXT
targ = parse_tag(h_env->tagbuf->ptr);
@@ -2610,12 +2625,7 @@
}
if (cmd == HTML_UL)
envs[h_env->envc].type = ul_type(targ, 0);
- if (!(obuf->flag & RB_IGNORE_P)) {
- flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
- if (!(obuf->flag & RB_PREMODE) && h_env->envc == 1)
- do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
- }
- else if (cmd == HTML_BLQ)
+ if (cmd == HTML_BLQ)
flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit);
return 1;
case HTML_N_UL:
@@ -3134,7 +3144,6 @@
table_mode[obuf->table_level].pre_mode = 0;
table_mode[obuf->table_level].indent_level = 0;
table_mode[obuf->table_level].nobr_level = 0;
- table_mode[obuf->table_level].mode_level = 0;
table_mode[obuf->table_level].caption = 0;
tables[obuf->table_level]->total_width = table_width[obuf->table_level];
if (table_width[obuf->table_level] == 0) {
@@ -3967,7 +3976,7 @@
#ifdef MENU_SELECT
| RB_INSELECT
#endif
- | RB_XMPMODE | RB_LSTMODE | RB_IGNORE)) {
+ | RB_IGNORE)) {
Str tok = Strnew(), tmp;
if (obuf->status != R_ST_NORMAL && h_env->tagbuf->length > 0) {
tmp = Strdup(h_env->tagbuf);
@@ -3977,7 +3986,7 @@
}
while (str_bak = str,
read_token(tok, &str, &obuf->status,
- (obuf->flag & (RB_INTXTA | RB_XMPMODE | RB_LSTMODE)) ? 1 : 0, 0)) {
+ (obuf->flag & RB_INTXTA) ? 1 : 0, 0)) {
char *p = tok->ptr;
int status, cmd = -1;
if (ST_IS_COMMENT(obuf->status))
@@ -4010,16 +4019,6 @@
feed_select(tok->ptr);
}
#endif
- /*
.. : Don't process tag */
- /* .. : ignore tag */
- else if (obuf->flag & (RB_XMPMODE | RB_LSTMODE)) {
- if (((obuf->flag & RB_XMPMODE) && cmd == HTML_N_XMP) ||
- ((obuf->flag & RB_LSTMODE) && cmd == HTML_N_LISTING)) {
- str = str_bak;
- break;
- }
- goto read_as_plain;
- }
/* script */
else if (obuf->flag & RB_IGNORE) {
if (TAG_IS(tok->ptr, obuf->ignore_tag->ptr,
@@ -4103,19 +4102,8 @@
*/
if (ST_IS_TAG(obuf->status)) {
/*** continuation of a tag ***/
- read_token(h_env->tagbuf, &str, &obuf->status, 0, 1);
- if (obuf->status != R_ST_NORMAL) {
- if (*str == '\0') {
- if (str[-1] != '\n')
- Strcat_char(h_env->tagbuf, '\n');
- return;
- }
- if (obuf->status == R_ST_DQUOTE) {
- if (Strlastchar(h_env->tagbuf) == '\n') {
- Strchop(h_env->tagbuf);
- }
- }
- }
+ read_token(h_env->tagbuf, &str, &obuf->status,
+ obuf->flag & (RB_XMPMODE | RB_LSTMODE), 1);
}
else {
if (!REALLY_THE_BEGINNING_OF_A_TAG(str)) {
@@ -4125,33 +4113,40 @@
str++;
continue;
}
- read_token(h_env->tagbuf, &str, &obuf->status, 0, 0);
- if (ST_IS_COMMENT(obuf->status)) {
- if (obuf->flag & RB_IGNORE)
- /* within ignored tag, such as *
- * , don't process comment. */
- obuf->status = R_ST_NORMAL;
- return;
- }
- if (h_env->tagbuf->length == 0)
- continue;
+ read_token(h_env->tagbuf, &str, &obuf->status,
+ obuf->flag & (RB_XMPMODE | RB_LSTMODE), 0);
+ }
+ if (ST_IS_COMMENT(obuf->status)) {
+ if (obuf->flag & RB_IGNORE)
+ /* within ignored tag, such as *
+ * , don't process comment. */
+ obuf->status = R_ST_NORMAL;
+ return;
+ }
+ if (h_env->tagbuf->length == 0)
+ continue;
/*** Beginning of a new tag ***/
- if (obuf->flag & RB_PLAIN)
- goto read_as_plain; /* don't process tag */
- if (obuf->status != R_ST_NORMAL) {
- if (obuf->status == R_ST_DQUOTE) {
- if (Strlastchar(h_env->tagbuf) == '\n') {
- Strchop(h_env->tagbuf);
- }
- }
- /* contine to the next line */
- if (str[-1] != '\n')
+ if (obuf->flag & RB_PLAIN)
+ goto read_as_plain; /* don't process tag */
+ if (*str == '\0' && obuf->status != R_ST_NORMAL) {
+ if (!(obuf->flag & (RB_XMPMODE | RB_LSTMODE))) {
+ if (obuf->status == R_ST_DQUOTE &&
+ Strlastchar(h_env->tagbuf) == '\n')
+ Strchop(h_env->tagbuf);
+ else if (str[-1] != '\n')
Strcat_char(h_env->tagbuf, '\n');
- return;
}
+ return;
}
q = h_env->tagbuf->ptr;
cmd = gethtmlcmd(&q, &status);
+ if (obuf->flag & RB_XMPMODE && cmd != HTML_N_XMP ||
+ obuf->flag & RB_LSTMODE && cmd != HTML_N_LISTING) {
+ Str tmp = Strdup(h_env->tagbuf);
+ Strcat_charp(tmp, str);
+ str = tmp->ptr;
+ goto read_as_plain;
+ }
#ifdef ID_EXT
targ = parse_tag(h_env->tagbuf->ptr);
/* process tags */
@@ -4205,7 +4200,7 @@
} while (obuf->pos % Tabstop != 0);
str++;
}
- else if (obuf->flag & RB_XMPMODE) {
+ else if (obuf->flag & (RB_XMPMODE | RB_LSTMODE)) {
char *p = htmlquote_char(*str);
if (p) {
while (*p) {
@@ -4671,8 +4666,11 @@
HTMLlineproc1("", &htmlenv1);
#endif
/* for unbalanced table tag */
- while (obuf.table_level > 0)
+ while (obuf.table_level > 0) {
+ table_mode[obuf.table_level -1].pre_mode
+ &= ~(TBLM_IGNORE | TBLM_XMP | TBLM_LST);
HTMLlineproc1("", &htmlenv1);
+ }
flushline(&htmlenv1, &obuf, 0, 0, htmlenv1.limit);
if (htmlenv1.title)
diff -urN w3m-0.1.10/main.c w3m-0.1.10-fix/main.c
--- w3m-0.1.10/main.c Tue Jun 6 14:56:48 2000
+++ w3m-0.1.10-fix/main.c Sat Jun 10 13:21:42 2000
@@ -1556,7 +1556,7 @@
}
else
gotoRealLine(Currentbuf, atoi(l));
- arrangeLine(Currentbuf);
+ arrangeCursor(Currentbuf);
displayBuffer(Currentbuf, B_FORCE_REDRAW);
}
diff -urN w3m-0.1.10/table.c w3m-0.1.10-fix/table.c
--- w3m-0.1.10/table.c Tue Jun 6 14:39:13 2000
+++ w3m-0.1.10-fix/table.c Sun Jun 11 06:29:44 2000
@@ -779,7 +779,13 @@
else
HTMLlineproc1(l->ptr, &h_env);
}
+#if 1
flushline(&h_env, &obuf, 0, 0, h_env.limit);
+#else
+ flushline(&h_env, &obuf, 0, 0, h_env.limit);
+ if (tbl->border_mode == BORDER_NONE && row < tbl->maxrow)
+ do_blankline(&h_env, &obuf, 0, 0, h_env.limit);
+#endif
}
static void
@@ -1437,8 +1443,10 @@
if (tl->nitem > 0) {
TextListItem *ti;
tmp = Strnew_charp("");
- for (ti = tl->first; ti != NULL; ti = ti->next)
+ for (ti = tl->first; ti != NULL; ti = ti->next) {
Strcat_charp(tmp, ti->ptr);
+ Strcat_char(tmp, '\n');
+ }
Strcat_charp(tmp, "");
HTMLlineproc1(tmp->ptr, h_env);
}
@@ -1654,11 +1662,14 @@
}
maxheight += t->tabheight[r];
}
- if (t->border_mode == BORDER_THIN || t->border_mode == BORDER_THICK) {
+ switch (t->border_mode) {
+ case BORDER_THIN:
+ case BORDER_THICK:
renderbuf = Strnew();
print_sep(t, t->maxrow, T_BOTTOM, t->maxcol, renderbuf);
HTMLlineproc1(renderbuf->ptr, h_env);
maxheight += 1;
+ break;
}
if (maxheight == 0)
HTMLlineproc1(" ", h_env);
@@ -1944,6 +1955,7 @@
*