Index: file.c =================================================================== RCS file: /usr/opt/share/cvsroot/w3m/file.c,v retrieving revision 1.3 diff -c -r1.3 file.c *** file.c 2000/02/09 13:54:51 1.3 --- file.c 2000/02/23 11:48:24 *************** *** 2214,2219 **** --- 2214,2237 ---- } } + #ifdef ID_EXT + static void + process_idattr(struct readbuffer *obuf, int cmd, struct parsed_tagarg *t) + { + Str id = NULL; + + for (; t; t = t->next) { + if (!strcasecmp(t->arg, "name") && (cmd == HTML_A)) + return; + if (!strcasecmp(t->arg, "id")) + id = Sprintf("", t->value); + } + if (id == NULL) + return; + push_tag(obuf, id->ptr, HTML_A); + } + #endif + #define CLOSE_P if (obuf->flag & RB_P) { \ flushline(h_env, obuf, envs[h_env->envc].indent,0,h_env->limit);\ RB_RESTORE_FLAG(obuf);\ *************** *** 2467,2474 **** break; case HTML_OL: type = envs[h_env->envc].type; ! targ = parse_tag(h_env->tagbuf->ptr); ! for (t = targ; t; t = t->next) { if (!strcasecmp(t->arg, "type") && t->value) type = (int)*t->value; } --- 2485,2491 ---- break; case HTML_OL: type = envs[h_env->envc].type; ! targ = parse_tag(h_env->tagbuf->ptr); for (t = targ; t; t = t->next) { if (!strcasecmp(t->arg, "type") && t->value) type = (int)*t->value; } *************** *** 3398,3407 **** if (frameset_s[frameset_sp] == NULL) break; if (frameset_sp == 0) { ! if (buf->frameset == NULL) buf->frameset = frameset_s[frameset_sp]; ! else ! pushFrameTree(&(buf->frameQ), frameset_s[frameset_sp]); } else addFrameSet(frameset_s[frameset_sp-1],frameset_s[frameset_sp]); --- 3415,3424 ---- if (frameset_s[frameset_sp] == NULL) break; if (frameset_sp == 0) { ! if (buf->frameset == NULL) { buf->frameset = frameset_s[frameset_sp]; ! } ! pushFrameTree(&(buf->frameQ), frameset_s[frameset_sp]); } else addFrameSet(frameset_s[frameset_sp-1],frameset_s[frameset_sp]); *************** *** 3541,3546 **** --- 3558,3566 ---- int i; struct readbuffer *obuf = h_env->obuf; int indent; + #ifdef ID_EXT + struct parsed_tagarg *targ; + #endif if (w3m_debug) { FILE *f = fopen("zzzproc1","a"); *************** *** 3813,3818 **** --- 3833,3842 ---- /* preserve the tag for second-stage processing */ push_tag(obuf, h_env->tagbuf->ptr, cmd); } + #ifdef ID_EXT + targ = parse_tag(h_env->tagbuf->ptr); + process_idattr(obuf, cmd, targ); + #endif obuf->bp.init_flag = 1; clear_ignore_p_flag(cmd,obuf); continue; Index: table.h =================================================================== RCS file: /usr/opt/share/cvsroot/w3m/table.h,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 table.h *** table.h 2000/01/06 15:27:28 1.1.1.1 --- table.h 2000/02/23 11:48:33 *************** *** 81,86 **** --- 81,90 ---- TextList ***tabdata; table_attr **tabattr; table_attr trattr; + #ifdef ID_EXT + Str **tabidvalue; + Str *tridvalue; + #endif short tabwidth[MAXCOL]; short minimum_width[MAXCOL]; short fixed_width[MAXCOL]; Index: table.c =================================================================== RCS file: /usr/opt/share/cvsroot/w3m/table.c,v retrieving revision 1.2 diff -c -r1.2 table.c *** table.c 2000/01/25 12:50:00 1.2 --- table.c 2000/02/23 11:48:53 *************** *** 263,273 **** --- 263,281 ---- t->tabdata = New_N(TextList**,MAXROW); t->tabattr = New_N(table_attr*,MAXROW); t->tabheight = NewAtom_N(short,MAXROW); + #ifdef ID_EXT + t->tabidvalue = New_N(Str*,MAXROW); + t->tridvalue = New_N(Str,MAXROW); + #endif for (i = 0; i < MAXROW; i++) { t->tabdata[i] = NULL; t->tabattr[i] = 0; t->tabheight[i] = 0; + #ifdef ID_EXT + t->tabidvalue[i] = NULL; + t->tridvalue[i] = NULL; + #endif } for (j = 0; j < MAXCOL; j++) { t->tabwidth[j] = 0; *************** *** 302,335 **** --- 310,369 ---- TextList ***tabdata; table_attr **tabattr; short *tabheight; + #ifdef ID_EXT + Str **tabidvalue; + Str *tridvalue; + #endif if (row >= t->max_rowsize) { r = max(t->max_rowsize*2, row + 1); tabdata = New_N(TextList**,r); tabattr = New_N(table_attr*,r); tabheight = New_N(short,r); + #ifdef ID_EXT + tabidvalue = New_N(Str*,r); + tridvalue = New_N(Str, r); + #endif for (i = 0; i < t->max_rowsize; i++) { tabdata[i] = t->tabdata[i]; tabattr[i] = t->tabattr[i]; tabheight[i] = t->tabheight[i]; + #ifdef ID_EXT + tabidvalue[i] = t->tabidvalue[i]; + tridvalue[i] = t->tridvalue[i]; + #endif } for (; i < r; i++) { tabdata[i] = NULL; tabattr[i] = NULL; tabheight[i] = 0; + #ifdef ID_EXT + tabidvalue[i] = NULL; + tridvalue[i] = NULL; + #endif } t->tabdata = tabdata; t->tabattr = tabattr; t->tabheight = tabheight; + #ifdef ID_EXT + t->tabidvalue = tabidvalue; + t->tridvalue = tridvalue; + #endif t->max_rowsize = r; } if (t->tabdata[row] == NULL) { t->tabdata[row] = New_N(TextList*,MAXCOL); t->tabattr[row] = NewAtom_N(table_attr,MAXCOL); + #ifdef ID_EXT + t->tabidvalue[row] = New_N(Str,MAXCOL); + #endif for (i = 0; i < MAXCOL; i++) { t->tabdata[row][i] = NULL; t->tabattr[row][i] = 0; + #ifdef ID_EXT + t->tabidvalue[row][i] = NULL; + #endif } } } *************** *** 1375,1380 **** --- 1409,1417 ---- #endif int maxheight = 0; Str vrulea, vruleb, vrulec; + #ifdef ID_EXT + Str idtag; + #endif if (t->maxcol < 0) { make_caption(t, h_env); *************** *** 1505,1512 **** --- 1542,1561 ---- renderbuf = Strnew(); if (t->border_mode == BORDER_THIN || t->border_mode == BORDER_THICK) Strcat(renderbuf,vrulea); + #ifdef ID_EXT + if (t->tridvalue[r] != NULL && h == 0) { + idtag = Sprintf("", (t->tridvalue[r])->ptr); + Strcat(renderbuf, idtag); + } + #endif for (i = 0; i <= t->maxcol; i++) { check_row(t,r); + #ifdef ID_EXT + if (t->tabidvalue[r][i] != NULL && h == 0) { + idtag = Sprintf("", (t->tabidvalue[r][i])->ptr); + Strcat(renderbuf, idtag); + } + #endif if (!(t->tabattr[r][i] & HTT_X)) { w = t->tabwidth[i]; for (j = i + 1; *************** *** 1806,1811 **** --- 1855,1865 ---- else if (!strcasecmp(t->value, "center")) align = (HTT_CENTER | HTT_TRSET); } + #ifdef ID_EXT + if (!strcasecmp(t->arg, "id") && t->value) { + tbl->tridvalue[tbl->row] = Strnew_charp(t->value); + } + #endif } tbl->trattr = align; break; *************** *** 1899,1904 **** --- 1953,1962 ---- } } else continue; + #ifdef ID_EXT + } else if (!strcasecmp(t->arg, "id") && t->value) { + tbl->tabidvalue[tbl->row][tbl->col] = Strnew_charp(t->value); + #endif } } tbl->tabattr[tbl->row][tbl->col] &= ~HTT_ALIGN;