w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 74d57c9d7659b845073d6a8fa7f8ce3f13e41109
parent 441539df1c807173509e2d50286502b9b01693fa
Author: ukai <ukai>
Date:   Tue,  5 Feb 2002 12:31:27 +0000

[w3m-dev 02991] form support in w3m -halfdump foo.html|w3m -halfload
* fm.h (DUMP_HALFEXTRA): deleted
* proto.h (process_select): return Str
* file.c (process_img): process_form() fix
* file.c (process_input): process_form() fix
* file.c (process_select): return Str
			process_form() fix
* file.c (process_textarea): process_form() fix
* file.c (process_form): support -halfdump
* file.c (HTMLtagproc1): delete case HTML_FORM_INT, HTML_N_FORM_INT
			process_{form,select,textarea}() fix
* file.c (HTMLlineproc2body): support -halfload
		HTML_INTERNAL, HTML_N_INTERNAL,
		HTML_FORM_INT, HTML_FORM_INT,
		HTML_TEXTAREA_INT, HTML_N_TEXTAREA_INT,
		HTML_SELECT_INT, HTML_N_SELECT_INT,
		HTML_OPTION_INT, HTML_TITLE_ALT
* file.c (print_internal_information): fix -halfdump
* file.c (loadHTMLstream): no DUMP_HALFEXTRA
* html.h: add HTML_INTERNAL, HTML_N_INTERNAL,
		HTML_SELECT_INT, HTML_N_SELECT_INT,
		HTML_OPTION_INT, HTML_TEXTAREA_INT, HTML_N_TEXTAREA_INT
* html.c (ALST_TEXTAREA_INT): added
* html.c (ALST_SELECT_INT): added
* html.c: add <internal>, </internal>, <select_int>, </select_int>
	<option_int>, <textarea_int>, </textarea_int>
* main.c (MAIN): delete -halfdump_extra
	dont output <pre> by -halfdump
* table.c (feed_table_tag): process_{form,select}() fix
	add case HTML_INTERNAL, HTML_N_INTERNAL,
	    HTML_SELECT_INT, HTML_N_SELECT_INT,
	    HTML_OPTION_INT, HTML_TEXTAREA_INT, HTML_N_TEXTAREA_INT,
* tagtable.tab: add internal, /internal, select_int, /select_int
	option_int, textarea_int, /textarea_int
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>

Diffstat:
MChangeLog | 37+++++++++++++++++++++++++++++++++++++
Mfile.c | 241+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
Mfm.h | 1-
Mhtml.c | 18+++++++++++-------
Mhtml.h | 7+++++++
Mmain.c | 9---------
Mproto.h | 2+-
Mtable.c | 18+++++++++++++++---
Mtagtable.tab | 7+++++++
9 files changed, 283 insertions(+), 57 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,40 @@ +2002-02-05 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 02991] form support in w3m -halfdump foo.html|w3m -halfload + * fm.h (DUMP_HALFEXTRA): deleted + * proto.h (process_select): return Str + * file.c (process_img): process_form() fix + * file.c (process_input): process_form() fix + * file.c (process_select): return Str + process_form() fix + * file.c (process_textarea): process_form() fix + * file.c (process_form): support -halfdump + * file.c (HTMLtagproc1): delete case HTML_FORM_INT, HTML_N_FORM_INT + process_{form,select,textarea}() fix + * file.c (HTMLlineproc2body): support -halfload + HTML_INTERNAL, HTML_N_INTERNAL, + HTML_FORM_INT, HTML_FORM_INT, + HTML_TEXTAREA_INT, HTML_N_TEXTAREA_INT, + HTML_SELECT_INT, HTML_N_SELECT_INT, + HTML_OPTION_INT, HTML_TITLE_ALT + * file.c (print_internal_information): fix -halfdump + * file.c (loadHTMLstream): no DUMP_HALFEXTRA + * html.h: add HTML_INTERNAL, HTML_N_INTERNAL, + HTML_SELECT_INT, HTML_N_SELECT_INT, + HTML_OPTION_INT, HTML_TEXTAREA_INT, HTML_N_TEXTAREA_INT + * html.c (ALST_TEXTAREA_INT): added + * html.c (ALST_SELECT_INT): added + * html.c: add <internal>, </internal>, <select_int>, </select_int> + <option_int>, <textarea_int>, </textarea_int> + * main.c (MAIN): delete -halfdump_extra + dont output <pre> by -halfdump + * table.c (feed_table_tag): process_{form,select}() fix + add case HTML_INTERNAL, HTML_N_INTERNAL, + HTML_SELECT_INT, HTML_N_SELECT_INT, + HTML_OPTION_INT, HTML_TEXTAREA_INT, HTML_N_TEXTAREA_INT, + * tagtable.tab: add internal, /internal, select_int, /select_int + option_int, textarea_int, /textarea_int + 2002-02-05 Fumitoshi UKAI <ukai@debian.or.jp> * [w3m-dev 02990] diff --git a/file.c b/file.c @@ -2828,9 +2828,12 @@ process_img(struct parsed_tag *tag, int width) } #endif if (r) { + Str tmp2; r2 = strchr(r, '#'); s = "<form_int method=internal action=map>"; - process_form(parse_tag(&s, TRUE)); + tmp2 = process_form(parse_tag(&s, TRUE)); + if (tmp2) + Strcat(tmp, tmp2); Strcat(tmp, Sprintf("<input_alt fid=\"%d\" " "type=hidden name=link value=\"", cur_form_id)); Strcat_charp(tmp, html_quote((r2) ? r2 + 1 : r)); @@ -3068,13 +3071,13 @@ process_input(struct parsed_tag *tag) { int i, w, v, x, y, z, iw, ih; char *q, *p, *r, *p2, *s; - Str tmp; + Str tmp = Strnew(); char *qq = ""; int qlen = 0; if (cur_form_id < 0) { char *s = "<form_int method=internal action=none>"; - process_form(parse_tag(&s, TRUE)); + tmp = process_form(parse_tag(&s, TRUE)); } p = "text"; @@ -3124,7 +3127,7 @@ process_input(struct parsed_tag *tag) qlen = strlen(q); } - tmp = Strnew_charp("<pre_int>"); + Strcat_charp(tmp, "<pre_int>"); switch (v) { case FORM_INPUT_PASSWORD: case FORM_INPUT_TEXT: @@ -3241,14 +3244,15 @@ process_input(struct parsed_tag *tag) return tmp; } -void +Str process_select(struct parsed_tag *tag) { + Str tmp = NULL; char *p; if (cur_form_id < 0) { char *s = "<form_int method=internal action=none>"; - process_form(parse_tag(&s, TRUE)); + tmp = process_form(parse_tag(&s, TRUE)); } p = ""; @@ -3277,6 +3281,7 @@ process_select(struct parsed_tag *tag) cur_option = NULL; cur_status = R_ST_NORMAL; n_selectitem = 0; + return tmp; } Str @@ -3413,11 +3418,12 @@ process_option(void) Str process_textarea(struct parsed_tag *tag, int width) { + Str tmp = NULL; char *p; if (cur_form_id < 0) { char *s = "<form_int method=internal action=none>"; - process_form(parse_tag(&s, TRUE)); + tmp = process_form(parse_tag(&s, TRUE)); } p = ""; @@ -3445,7 +3451,7 @@ process_textarea(struct parsed_tag *tag, int width) textarea_str[n_textarea] = Strnew(); ignore_nl_textarea = TRUE; - return NULL; + return tmp; } Str @@ -3608,6 +3614,7 @@ process_form(struct parsed_tag *tag) parsedtag_get_value(tag, ATTR_TARGET, &tg); n = NULL; parsedtag_get_value(tag, ATTR_NAME, &n); + form_max++; form_sp++; if (forms_size == 0) { @@ -3620,11 +3627,28 @@ process_form(struct parsed_tag *tag) forms = New_Reuse(FormList *, forms, forms_size); form_stack = New_Reuse(int, form_stack, forms_size); } + form_stack[form_sp] = form_max; + + if (w3m_halfdump) { + Str tmp = Sprintf("<form_int fid=\"%d\" action=\"%s\" method=\"%s\"", + form_max, html_quote(q), p); + if (s) + Strcat(tmp, Sprintf(" enctype=\"%s\"", html_quote(s))); + if (tg) + Strcat(tmp, Sprintf(" target=\"%s\"", html_quote(tg))); + if (n) + Strcat(tmp, Sprintf(" name=\"%s\"", html_quote(n))); +#ifdef JP_CHARSET + if (r) + Strcat(tmp, Sprintf(" accept-charset=\"%s\"", code_to_str(cs))); +#endif + Strcat_charp(tmp, ">"); + return tmp; + } + forms[form_max] = newFormList(q, p, &cs, s, tg, n, (form_max > 0) ? forms[form_max - 1] : NULL); - form_stack[form_sp] = form_max; - return NULL; } @@ -4308,14 +4332,14 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) RB_RESTORE_FLAG(obuf); return 1; case HTML_FORM: - case HTML_FORM_INT: CLOSE_P; if (!(obuf->flag & RB_IGNORE_P)) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); - process_form(tag); + tmp = process_form(tag); + if (tmp) + HTMLlineproc1(tmp->ptr, h_env); return 1; case HTML_N_FORM: - case HTML_N_FORM_INT: CLOSE_P; flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag |= RB_IGNORE_P; @@ -4327,7 +4351,9 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) HTMLlineproc1(tmp->ptr, h_env); return 1; case HTML_SELECT: - process_select(tag); + tmp = process_select(tag); + if (tmp) + HTMLlineproc1(tmp->ptr, h_env); obuf->flag |= RB_INSELECT; return 1; case HTML_N_SELECT: @@ -4340,7 +4366,9 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) /* nothing */ return 1; case HTML_TEXTAREA: - process_textarea(tag, h_env->limit); + tmp = process_textarea(tag, h_env->limit); + if (tmp) + HTMLlineproc1(tmp->ptr, h_env); obuf->flag |= RB_INTXTA; return 1; case HTML_N_TEXTAREA: @@ -4554,18 +4582,41 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) #ifndef KANJI_SYMBOLS char rule = 0; #endif + int internal = 0; + Anchor **a_textarea = NULL; +#ifdef MENU_SELECT + Anchor **a_select = NULL; +#endif + + n_textarea = -1; + if (!max_textarea) { /* halfload */ + max_textarea = MAX_TEXTAREA; + textarea_str = New_N(Str, max_textarea); + a_textarea = New_N(Anchor *, max_textarea); + } +#ifdef MENU_SELECT + n_select = -1; + if (!max_select) { /* halfload */ + max_select = MAX_SELECT; + select_option = New_N(FormSelectOption, max_select); + a_select = New_N(Anchor *, max_select); + } +#endif if (w3m_debug) debug = fopen("zzzerr", "a"); effect = 0; nlines = 0; - buf->formlist = (form_max >= 0) ? forms[form_max] : NULL; while ((line = feed()) != NULL) { if (w3m_debug) { Strfputs(line, debug); fputc('\n', debug); } + if (n_textarea >= 0 && *(line->ptr) != '<') { /* halfload */ + Strcat(textarea_str[n_textarea], line); + continue; + } proc_again: if (++nlines == llimit) break; @@ -4772,6 +4823,10 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) FormList *form; int top = 0, bottom = 0; int form_id = -1; + int textareanumber = -1; +#ifdef MENU_SELECT + int selectnumber = -1; +#endif hseq = 0; parsedtag_get_value(tag, ATTR_HSEQ, &hseq); @@ -4791,8 +4846,39 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) } if (!form->target) form->target = buf->baseTarget; + if (a_textarea && + parsedtag_get_value(tag, ATTR_TEXTAREANUMBER, + &textareanumber)) { + if (textareanumber >= max_textarea) { + max_textarea = 2 * textareanumber; + textarea_str = New_Reuse(Str, textarea_str, + max_textarea); + a_textarea = New_Reuse(Anchor *, a_textarea, + max_textarea); + } + } +#ifdef MENU_SELECT + if (a_select && + parsedtag_get_value(tag, ATTR_SELECTNUMBER, + &selectnumber)) { + if (selectnumber >= max_select) { + max_select = 2 * selectnumber; + select_option = New_Reuse(FormSelectOption, + select_option, + max_select); + a_select = New_Reuse(Anchor *, a_select, + max_select); + } + } +#endif a_form = registerForm(buf, form, tag, currentLn(buf), pos); + if (a_textarea && textareanumber >= 0) + a_textarea[textareanumber] = a_form; +#ifdef MENU_SELECT + if (a_select && selectnumber >= 0) + a_select[selectnumber] = a_form; +#endif if (a_form) { a_form->hseq = hseq - 1; a_form->y = currentLn(buf) - top; @@ -4888,6 +4974,67 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) buf->baseTarget = url_quote_conv(p, buf->document_code); break; + case HTML_INTERNAL: + internal = HTML_INTERNAL; + break; + case HTML_N_INTERNAL: + internal = HTML_N_INTERNAL; + break; + case HTML_FORM_INT: + process_form(tag); + break; + case HTML_TEXTAREA_INT: + if (parsedtag_get_value(tag, ATTR_TEXTAREANUMBER, + &n_textarea) + && n_textarea < max_textarea) { + textarea_str[n_textarea] = Strnew(); + } + else + n_textarea = -1; + break; + case HTML_N_TEXTAREA_INT: + if (n_textarea >= 0) { + FormItemList *item = + (FormItemList *)a_textarea[n_textarea]->url; + item->init_value = item->value = + textarea_str[n_textarea]; + } + break; +#ifdef MENU_SELECT + case HTML_SELECT_INT: + if (parsedtag_get_value(tag, ATTR_SELECTNUMBER, &n_select) + && n_select < max_select) { + select_option[n_select].first = NULL; + select_option[n_select].last = NULL; + } + else + n_select = -1; + break; + case HTML_N_SELECT_INT: + if (n_select >= 0) { + FormItemList *item = + (FormItemList *)a_select[n_select]->url; + item->select_option = select_option[n_select].first; + chooseSelectOption(item, item->select_option); + item->init_selected = item->selected; + item->init_value = item->value; + item->init_label = item->label; + } + break; + case HTML_OPTION_INT: + if (n_select >= 0) { + int selected; + q = ""; + parsedtag_get_value(tag, ATTR_LABEL, &q); + p = q; + parsedtag_get_value(tag, ATTR_VALUE, &p); + selected = parsedtag_exists(tag, ATTR_SELECTED); + addSelectOption(&select_option[n_select], + Strnew_charp(p), Strnew_charp(q), + selected); + } + break; +#endif case HTML_TITLE_ALT: if (parsedtag_get_value(tag, ATTR_TITLE, &p)) buf->buffername = html_unquote(p); @@ -4928,11 +5075,14 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) } } /* end of processing for one line */ - addnewline(buf, outc, outp, + if (!internal) + addnewline(buf, outc, outp, #ifdef USE_ANSI_COLOR - NULL, + NULL, #endif - pos, nlines); + pos, nlines); + if (internal == HTML_N_INTERNAL) + internal = 0; if (str != endp) { line = Strsubstr(line, str - line->ptr, endp - str); goto proc_again; @@ -4945,6 +5095,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit) #ifdef USE_IMAGE addMultirowsImg(buf, buf->img); #endif + buf->formlist = (form_max >= 0) ? forms[form_max] : NULL; } void @@ -5723,52 +5874,67 @@ print_internal_information(struct html_feed_environ *henv) Str s; TextLineList *tl = newTextLineList(); + s = Strnew_charp("<internal>"); + pushTextLine(tl, newTextLine(s, 0)); + if (henv->title) { + s = Strnew_m_charp("<title_alt title=\"", + html_quote(henv->title), "\">", NULL); + pushTextLine(tl, newTextLine(s, 0)); + } +#if 0 if (form_max >= 0) { FormList *fp; for (i = 0; i <= form_max; i++) { fp = forms[i]; s = Sprintf("<form_int fid=\"%d\" action=\"%s\" method=\"%s\"", - i, fp->action->ptr, + i, html_quote(fp->action->ptr), (fp->method == FORM_METHOD_POST) ? "post" : ((fp->method == FORM_METHOD_INTERNAL) ? "internal" : "get")); if (fp->target) - Strcat(s, Sprintf(" target=\"%s\"", fp->target)); + Strcat(s, Sprintf(" target=\"%s\"", html_quote(fp->target))); + if (fp->enctype == FORM_ENCTYPE_MULTIPART) + Strcat_charp(s, " enctype=\"multipart/form-data\""); #ifdef JP_CHARSET if (fp->charset) - Strcat(s, - Sprintf(" accept-charset=\"%s\"", - code_to_str(fp->charset))); + Strcat(s, Sprintf(" accept-charset=\"%s\"", + code_to_str(fp->charset))); #endif - if (fp->enctype == FORM_ENCTYPE_MULTIPART) - Strcat_charp(s, " enctype=multipart/form-data"); Strcat_charp(s, ">"); pushTextLine(tl, newTextLine(s, 0)); } } +#endif #ifdef MENU_SELECT if (n_select > 0) { FormSelectOptionItem *ip; for (i = 0; i < n_select; i++) { + s = Sprintf("<select_int selectnumber=%d>", i); + pushTextLine(tl, newTextLine(s, 0)); for (ip = select_option[i].first; ip; ip = ip->next) { - s = Sprintf("<option_int selectnumber=%d" - " value=\"%s\"%s>%s</option_int>", - i, - html_quote(ip->value ? ip->value->ptr : ip->label-> - ptr), ip->checked ? " selected" : "", - ip->label->ptr); + s = Sprintf("<option_int value=\"%s\" label=\"%s\"%s>", + html_quote(ip->value ? ip->value->ptr : + ip->label->ptr), + html_quote(ip->label->ptr), + ip->checked ? " selected" : ""); pushTextLine(tl, newTextLine(s, 0)); } + s = Strnew_charp("</select_int>"); + pushTextLine(tl, newTextLine(s, 0)); } } #endif /* MENU_SELECT */ if (n_textarea > 0) { for (i = 0; i < n_textarea; i++) { - s = Sprintf("<textarea_int textareanumber=%d>%s</textarea_int>", - i, textarea_str[i]->ptr); + s = Sprintf("<textarea_int textareanumber=%d>", i); + pushTextLine(tl, newTextLine(s, 0)); + s = Strnew_charp(html_quote(textarea_str[i]->ptr)); + Strcat_charp(s, "</textarea_int>"); pushTextLine(tl, newTextLine(s, 0)); } } + s = Strnew_charp("</internal>"); + pushTextLine(tl, newTextLine(s, 0)); if (henv->buf) appendTextLineList(henv->buf, tl); @@ -5826,6 +5992,10 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal) #ifdef JP_CHARSET newBuf->document_code = InnerCode; #endif /* JP_CHARSET */ + max_textarea = 0; +#ifdef MENU_SELECT + max_select = 0; +#endif HTMLlineproc3(newBuf, f->stream); w3m_halfload = FALSE; if (fmInitialized) @@ -5915,8 +6085,7 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal) if (fmInitialized) term_raw(); signal(SIGINT, prevtrap); - if (w3m_dump & DUMP_HALFEXTRA) - print_internal_information(&htmlenv1); + print_internal_information(&htmlenv1); return; } if (w3m_backend) { diff --git a/fm.h b/fm.h @@ -774,7 +774,6 @@ extern char *w3m_version; #define DUMP_EXTRA 0x08 #define DUMP_HALFDUMP 0x10 #define DUMP_FRAME 0x20 -#define DUMP_HALFEXTRA 0x40 global int w3m_debug; global int w3m_dump init(0); #define w3m_halfdump (w3m_dump & DUMP_HALFDUMP) diff --git a/html.c b/html.c @@ -84,6 +84,10 @@ unsigned char ALST_APPLET[] = { ATTR_ARCHIVE, ATTR_CORE }; unsigned char ALST_EMBED[] = { ATTR_SRC, ATTR_CORE }; #define MAX_EMBED MAXA_CORE + 1 +unsigned char ALST_TEXTAREA_INT[] = { ATTR_TEXTAREANUMBER }; +#define MAXA_TEXTAREA_INT 1 +unsigned char ALST_SELECT_INT[] = { ATTR_SELECTNUMBER }; +#define MAXA_SELECT_INT 1 unsigned char ALST_TABLE_ALT[] = { ATTR_TID }; #define MAXA_TABLE_ALT 1 unsigned char ALST_RULE[] = { ATTR_TYPE }; @@ -213,15 +217,15 @@ TagInfo TagMAP[MAX_HTMLTAG] = { {NULL, NULL, 0, 0}, /* 103 Undefined */ {NULL, NULL, 0, 0}, /* 104 Undefined */ {NULL, NULL, 0, 0}, /* 105 Undefined */ - {NULL, NULL, 0, 0}, /* 106 Undefined */ - {NULL, NULL, 0, 0}, /* 107 Undefined */ - {NULL, NULL, 0, 0}, /* 108 Undefined */ - {NULL, NULL, 0, 0}, /* 109 Undefined */ - {NULL, NULL, 0, 0}, /* 110 Undefined */ - {NULL, NULL, 0, 0}, /* 111 Undefined */ - {NULL, NULL, 0, 0}, /* 112 Undefined */ /* pseudo tag */ + {"internal", NULL, 0, TFLG_INT}, /* 106 HTML_INTERNAL */ + {"/internal", NULL, 0, TFLG_INT | TFLG_END}, /* 107 HTML_N_INTERNAL */ + {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT}, /* 108 HTML_SELECT_INT */ + {"/select_int", NULL, 0, TFLG_INT | TFLG_END}, /* 109 HTML_N_SELECT_INT */ + {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT}, /* 110 HTML_OPTION_INT */ + {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT}, /* 111 HTML_TEXTAREA_INT */ + {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END}, /* 112 HTML_N_TEXTAREA_INT */ {"table_alt", ALST_TABLE_ALT, MAXA_TABLE_ALT, TFLG_INT}, /* 113 HTML_TABLE_ALT */ {"rule", ALST_RULE, MAXA_RULE, TFLG_INT}, /* 114 HTML_RULE */ {"/rule", NULL, 0, TFLG_INT | TFLG_END}, /* 115 HTML_N_RULE */ diff --git a/html.h b/html.h @@ -185,6 +185,13 @@ typedef struct { /* pseudo tag */ +#define HTML_INTERNAL 106 +#define HTML_N_INTERNAL 107 +#define HTML_SELECT_INT 108 +#define HTML_N_SELECT_INT 109 +#define HTML_OPTION_INT 110 +#define HTML_TEXTAREA_INT 111 +#define HTML_N_TEXTAREA_INT 112 #define HTML_TABLE_ALT 113 #define HTML_RULE 114 #define HTML_N_RULE 115 diff --git a/main.c b/main.c @@ -562,8 +562,6 @@ MAIN(int argc, char **argv, char **envp) w3m_dump = (DUMP_HEAD | DUMP_SOURCE | DUMP_EXTRA); else if (!strcmp("-halfdump", argv[i])) w3m_dump = DUMP_HALFDUMP; - else if (!strcmp("-halfdump_extra", argv[i])) - w3m_dump = DUMP_HALFDUMP | DUMP_HALFEXTRA; else if (!strcmp("-halfload", argv[i])) { w3m_dump = 0; w3m_halfload = TRUE; @@ -745,8 +743,6 @@ MAIN(int argc, char **argv, char **envp) orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); err_msg = Strnew(); if (load_argc == 0) { - if (w3m_halfdump) - printf("<pre>\n"); /* no URL specified */ if (!isatty(0)) { redin = newFileStream(fdopen(dup(0), "rb"), (void (*)())pclose); @@ -810,8 +806,6 @@ MAIN(int argc, char **argv, char **envp) if (i >= 0) { SearchHeader = search_header; DefaultType = default_type; - if (w3m_halfdump) - printf("<pre>\n"); if (w3m_dump == DUMP_HEAD) { request = New(FormList); request->method = FORM_METHOD_HEAD; @@ -892,9 +886,6 @@ MAIN(int argc, char **argv, char **envp) rFrame(); saveBuffer(Currentbuf, stdout); } - if (w3m_halfdump) - printf("</pre><title>%s</title>\n", - html_quote(newbuf->buffername)); } else { if (Currentbuf->frameset != NULL && RenderFrame) diff --git a/proto.h b/proto.h @@ -154,7 +154,7 @@ extern int getImageSize(ImageCache * cache); extern Str process_img(struct parsed_tag *tag, int width); extern Str process_anchor(struct parsed_tag *tag, char *tagbuf); extern Str process_input(struct parsed_tag *tag); -extern void process_select(struct parsed_tag *tag); +extern Str process_select(struct parsed_tag *tag); extern Str process_n_select(void); extern void feed_select(char *str); extern void process_option(void); diff --git a/table.c b/table.c @@ -2806,7 +2806,9 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, break; case HTML_FORM: feed_table_block_tag(tbl, "", mode, 0, cmd); - process_form(tag); + tmp = process_form(tag); + if (tmp) + feed_table1(tbl, tmp, mode, width); break; case HTML_N_FORM: feed_table_block_tag(tbl, "", mode, 0, cmd); @@ -2817,7 +2819,9 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, feed_table1(tbl, tmp, mode, width); break; case HTML_SELECT: - process_select(tag); + tmp = process_select(tag); + if (tmp) + feed_table1(tbl, tmp, mode, width); mode->pre_mode |= TBLM_INSELECT; break; case HTML_N_SELECT: @@ -2839,7 +2843,8 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, w = tbl->fixed_width[tbl->col]; } tmp = process_textarea(tag, w); - feed_table1(tbl, tmp, mode, width); + if (tmp) + feed_table1(tbl, tmp, mode, width); mode->pre_mode |= TBLM_INTXTA; break; case HTML_N_TEXTAREA: @@ -2937,10 +2942,17 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, case HTML_NOP: suspend_or_pushdata(tbl, line); break; + case HTML_INTERNAL: + case HTML_N_INTERNAL: case HTML_FORM_INT: case HTML_N_FORM_INT: case HTML_INPUT_ALT: case HTML_N_INPUT_ALT: + case HTML_SELECT_INT: + case HTML_N_SELECT_INT: + case HTML_OPTION_INT: + case HTML_TEXTAREA_INT: + case HTML_N_TEXTAREA_INT: case HTML_IMG_ALT: case HTML_EOL: case HTML_RULE: diff --git a/tagtable.tab b/tagtable.tab @@ -155,3 +155,10 @@ pre_int HTML_PRE_INT bgsound HTML_BGSOUND applet HTML_APPLET embed HTML_EMBED +internal HTML_INTERNAL +/internal HTML_N_INTERNAL +select_int HTML_SELECT_INT +/select_int HTML_N_SELECT_INT +option_int HTML_OPTION_INT +textarea_int HTML_TEXTAREA_INT +/textarea_int HTML_N_TEXTAREA_INT