$B$d$^$F(B@$B?ALn$G$9!#(B
> $BBP:v$O$$$^=q$$$F$^$9!#$b$&$"$H(B30$BJ,BT$C$F$M!#(B
$B0l;~4V0J>e$+$+$C$?!#ESCf$G0l2s<:GT$7$?$7!#(B
> 1. CLOSE_ANCHOR$B$O(Bobuf->anchor$B$GJD$8$k!&JD$8$J$$$r7hDj$7$F$$$k(B
$B$K$D$$$F$N(Bpatch$B$G$9!#AG$N(Bw3m-0.1.10pre$B$+$i$N(Bpatch$B$G$9$,!"B0@-BP:v$O(B
$BF~$C$F$$$^$;$s!#(B
$B0lIt!"@07A$N$_%Q%C%A$,F~$C$F$^$9!#(B
> 2. HTMLtagproc1$B$O:F5"E*$K8F$S=P$5$l$k(B
$B$O!D!D$A$g$C$HJ}K!$r;W$$$D$+$J$$$s$G$9$1$I!#$I$&$9$l$P$$$$$N$G$7$g$&!#(B
HTMLlineproc2body$B$G$4$^$+$7$F$b$-$C$H(Bframeset rendering$B$G0z$C3]$+$k$+(B
$B$i!"85(Btag$B$+$i(BID$B$r0z$C$3H4$/$7$+<j$O$J$$$H;W$&$N$G$9$,!D!D(B
--- $B$d$^$F(B
diff -rU3 -x *[^.]? -x *.[^ch] -x config.h w3m/file.c w3m.new/file.c --- w3m/file.c Sat May 20 20:59:22 2000 +++ w3m.new/file.c Sat May 20 22:21:32 2000 @@ -1177,7 +1180,7 @@ switch (ch) { case ',': case '.': - case '\"': + case '\"': /* " */ case '\'': case '$': case '%': @@ -2363,19 +2365,48 @@ /* * HTML_TABLE is handled by the other process. */ + if (cmd == HTML_A) + return; if (cmd == HTML_TABLE) return; for (; t; t = t->next) { - if (!strcasecmp(t->arg, "name") && (cmd == HTML_A)) + if (!strcasecmp(t->arg, "name")) return; if (!strcasecmp(t->arg, "id")) - id = Sprintf("<a name=\"%s\">", t->value); + id = Sprintf("<a id=\"%s\">", t->value); } if (id == NULL) return; push_tag(obuf, id->ptr, HTML_A); } + +static struct parsed_tagarg * +pick_id(int cmd, struct parsed_tagarg **targp) +{ + struct parsed_tagarg *id = NULL, *t; + + /* + * HTML_TABLE is handled by the other process. + */ + if (cmd == HTML_A) + return id; + if (cmd == HTML_TABLE) + return id; + + while (*targp) { + t = *targp; + if (!strcasecmp(t->arg, "id")) { + *targp = t->next; + t->next = id; + id = t; + } else { + targp = &t->next; + } + } + + return id; +} #endif /* ID_EXT */ #define CLOSE_P if (obuf->flag & RB_P) { \ @@ -2428,26 +2459,26 @@ HTMLtagproc1(int cmd, struct html_feed_environ *h_env) #endif /* ID_EXT */ { - char *p, - *q, - *r; - int i, - w, - x, - y, - type, - count; + char *p, + *q, + *r; + int i, + w, + x, + y, + type, + count; #ifdef ID_EXT struct parsed_tagarg *t; #else struct parsed_tagarg *targ, *t; #endif /* ID_EXT */ - struct readbuffer *obuf = h_env->obuf; - struct environment *envs = h_env->envs; - Str tmp = Strnew(); - int hseq; + struct readbuffer *obuf = h_env->obuf; + struct environment *envs = h_env->envs; + Str tmp = Strnew(); + int hseq; #ifdef TABLE_EXPAND - int ppc = PIXEL_PER_CHAR; + int ppc = PIXEL_PER_CHAR; #endif /* TABLE_EXPAND */ #ifdef ID_EXT Str id = NULL; @@ -2922,7 +2964,8 @@ targ = parse_tag(h_env->tagbuf->ptr); #endif /* !ID_EXT */ hseq = 0; - obuf->anchor = NULL; + if (!targ || targ->next || strcasecmp(targ->arg, "id")) + obuf->anchor = NULL; for (t = targ; t; t = t->next) { if (strcasecmp(t->arg, "href") == 0 && t->value) { @@ -2946,7 +2989,7 @@ return 0; case HTML_N_A: CLOSE_ANCHOR - return 1; + return 1; case HTML_IMG: tmp = process_img(parse_tag(h_env->tagbuf->ptr)); HTMLlineproc1(tmp->ptr, h_env); @@ -3475,6 +3518,9 @@ else if (!strcasecmp(t->arg, "hseq") && t->value) { hseq = atoi(t->value); } + else if (!strcasecmp(t->arg, "id") && t->value) { + registerName(buf, t->value, currentLn(buf), pos)->hseq = -1; + } } if (hseq > 0) buf->hmarklist = @@ -3841,7 +3891,7 @@ struct readbuffer *obuf = h_env->obuf; int indent; #ifdef ID_EXT - struct parsed_tagarg *targ; + struct parsed_tagarg *targ, *idtarg; #endif /* ID_EXT */ if (w3m_debug) { @@ -4054,7 +4104,7 @@ * Tag processing */ if (ST_IS_TAG(obuf->status)) { -/*** continuation of a tag ***/ + /*** continuation of a tag ***/ read_token(h_env->tagbuf, &str, &obuf->status, 0, 1); if (obuf->status != R_ST_NORMAL) { if (*str == '\0') { @@ -4107,17 +4157,19 @@ cmd = gethtmlcmd(&q, &status); #ifdef ID_EXT targ = parse_tag(h_env->tagbuf->ptr); + idtarg = pick_id(cmd, &targ); /* process tags */ - if (HTMLtagproc1(cmd, targ, h_env) == 0) { + if (HTMLtagproc1(cmd, targ, h_env) == 0) #else /* process tags */ - if (HTMLtagproc1(cmd, h_env) == 0) { + if (HTMLtagproc1(cmd, h_env) == 0) #endif /* ID_EXT */ + { /* preserve the tag for second-stage processing */ push_tag(obuf, h_env->tagbuf->ptr, cmd); } #ifdef ID_EXT - process_idattr(obuf, cmd, targ); + process_idattr(obuf, cmd, idtarg); #endif /* ID_EXT */ obuf->bp.init_flag = 1; clear_ignore_p_flag(cmd, obuf); diff -rU3 -x *[^.]? -x *.[^ch] -x config.h w3m/fm.h w3m.new/fm.h --- w3m/fm.h Sat May 20 20:59:22 2000 +++ w3m.new/fm.h Sat May 20 18:36:07 2000 @@ -358,34 +358,34 @@ #define in_under fontstat[1] #define in_stand fontstat[2] -#define RB_PRE 0x01 -#define RB_XMPMODE 0x02 -#define RB_LSTMODE 0x04 -#define RB_PLAIN 0x08 -#define RB_LEFT 0x00 -#define RB_CENTER 0x10 -#define RB_RIGHT 0x20 -#ifdef FORMAT_NICE -#define RB_FILL 0x200000 -#endif /* FORMAT_NICE */ -#define RB_NOBR 0x40 -#define RB_P 0x80 -#define RB_PRE_INT 0x100 - -#define RB_SPECIAL (RB_PRE|RB_XMPMODE|RB_LSTMODE|RB_PLAIN|RB_NOBR|RB_PRE_INT) -#define RB_PREMODE (RB_PRE | RB_PRE_INT) -#define RB_ALIGN (RB_CENTER | RB_RIGHT) +#define RB_PRE 0x01 +#define RB_XMPMODE 0x02 +#define RB_LSTMODE 0x04 +#define RB_PLAIN 0x08 +#define RB_LEFT 0x00 +#define RB_CENTER 0x10 +#define RB_RIGHT 0x20 +#define RB_ALIGN (RB_CENTER | RB_RIGHT) +#define RB_NOBR 0x40 +#define RB_P 0x80 +#define RB_PRE_INT 0x100 +#define RB_PREMODE (RB_PRE | RB_PRE_INT) +#define RB_SPECIAL (RB_PRE|RB_XMPMODE|RB_LSTMODE|RB_PLAIN|RB_NOBR|RB_PRE_INT) -#define RB_INTXTA 0x400 -#define RB_IGNORE 0x1000 -#define RB_INSEL 0x2000 -#define RB_IGNORE_P 0x4000 +#define RB_IN_DT 0x200 +#define RB_INTXTA 0x400 #ifdef MENU -#define RB_INSELECT 0x800 +#define RB_INSELECT 0x800 #endif /* MENU */ -#define RB_IN_DT 0x200 +#define RB_IGNORE 0x1000 +#define RB_INSEL 0x2000 +#define RB_IGNORE_P 0x4000 +#define RB_TITLE 0x8000 -#define RB_N_TABLE 0x100000 +#define RB_N_TABLE 0x100000 +#ifdef FORMAT_NICE +#define RB_FILL 0x200000 +#endif /* FORMAT_NICE */ #define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN) #define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); } diff -rU3 -x *[^.]? -x *.[^ch] -x config.h w3m/proto.h w3m.new/proto.h --- w3m/proto.h Sat May 20 20:59:22 2000 +++ w3m.new/proto.h Sat May 20 15:28:18 2000 @@ -293,7 +293,6 @@ #endif /* COLOR */ extern void refresh(void); extern void clear(void); -extern void scroll_raw(void); extern void scroll(int); extern void rscroll(int); extern void need_clrtoeol(void); diff -rU3 -x *[^.]? -x *.[^ch] -x config.h w3m/table.c w3m.new/table.c --- w3m/table.c Sat May 20 20:59:22 2000 +++ w3m.new/table.c Sat May 20 18:16:17 2000 @@ -704,9 +704,7 @@ forbid |= 1; } } - if (forbid != 15) /* forbid==15 means 'no * * * rule at all' - * - * * */ + if (forbid != 15) /* forbid==15 means 'no rule at all' */ Strcat_charp(buf, rulep[forbid]); } } @@ -1630,7 +1628,7 @@ HTMLlineproc1("<pre for_table>", h_env); #ifdef ID_EXT if (t->id != NULL) { - idtag = Sprintf("<a name=\"%s\">", (t->id)->ptr); + idtag = Sprintf("<a id=\"%s\">", (t->id)->ptr); HTMLlineproc1(idtag->ptr, h_env); } #endif /* ID_EXT */ @@ -1673,7 +1671,7 @@ Strcat(renderbuf, vrulea); #ifdef ID_EXT if (t->tridvalue[r] != NULL && h == 0) { - idtag = Sprintf("<a name=\"%s\">", (t->tridvalue[r])->ptr); + idtag = Sprintf("<a id=\"%s\">", (t->tridvalue[r])->ptr); Strcat(renderbuf, idtag); } #endif /* ID_EXT */ @@ -1681,7 +1679,7 @@ check_row(t, r); #ifdef ID_EXT if (t->tabidvalue[r][i] != NULL && h == 0) { - idtag = Sprintf("<a name=\"%s\">", (t->tabidvalue[r][i])->ptr); + idtag = Sprintf("<a id=\"%s\">", (t->tabidvalue[r][i])->ptr); Strcat(renderbuf, idtag); } #endif /* ID_EXT */ @@ -2016,8 +2014,8 @@ cmd = gethtmlcmd(&s_line, &status); #ifdef MENU_SELECT - /* failsafe: a tag other than <option></option>and </select> in * * * - * * * <select> environment is regarded as the end of <select>. */ + /* failsafe: a tag other than <option></option>and </select> in + * <select> environment is regarded as the end of <select>. */ if ((mode->pre_mode & TBLM_INSELECT) && cmd != HTML_OPTION && cmd != HTML_N_OPTION && @@ -2123,16 +2121,10 @@ } else if (!strcasecmp(t->arg, "colspan") && t->value) { colspan = atoi(t->value); - if ((tbl->col + colspan) >= MAXCOL) - colspan = MAXCOL - tbl->col; /* Can't * * * - * * * * * * * - * * * * * * * - * * expand * * - * * * * * * * * - * * * * * * * - * * * column * - * * * * * * * * - */ + if ((tbl->col + colspan) >= MAXCOL) { + /* Can't expand column */ + colspan = MAXCOL - tbl->col; + } } else if (!strcasecmp(t->arg, "align") && t->value) { if (!strcasecmp(t->value, "left")) @@ -2402,8 +2394,7 @@ if (tmp) feed_table(tbl, tmp->ptr, mode, width); #ifdef MENU_SELECT - if (!tag_exists(t_arg, "multiple")) /* non-multiple * * * * * - * select */ + if (!tag_exists(t_arg, "multiple")) /* non-multiple select */ mode->pre_mode |= TBLM_INSELECT; #endif /* MENU_SELECT */ break; @@ -2603,7 +2594,7 @@ q = p; r = getescapecmd(&p); if (r != NULL && ((*r & 0x80) || IS_CNTRL(*r))) { - /* latin-1 * * * character */ + /* latin-1 character */ Strcat_charp(tmp, r); } else { @@ -2633,7 +2624,7 @@ if (mode->pre_mode & TBLM_NOBR && mode->nobr_offset < 0) mode->nobr_offset = tbl->tabcontentssize; - /* count of number of spaces skipped in normal * * * mode */ + /* count of number of spaces skipped in normal mode */ i = skip_space(tbl, line, linfo, !(mode->pre_mode & TBLM_NOBR)); addcontentssize(tbl, visible_length(line) - i); setwidth(tbl, mode);
This archive was generated by hypermail 2b29 : Wed Jul 19 2000 - 10:30:55 CDT