diff options
author | cinap_lenrek <cinap_lenrek@rei2.9hal> | 2011-11-06 16:13:46 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@rei2.9hal> | 2011-11-06 16:13:46 +0100 |
commit | b4fb5e238452052cd058a15240f5097135bfba35 (patch) | |
tree | eb241820cc63147a38b802ddf3a62d9d51363bed | |
parent | ff0dc1668f11abdab7b8b5738a7320731ac909e5 (diff) |
mothra: more tags
-rw-r--r-- | sys/src/cmd/mothra/forms.c | 8 | ||||
-rw-r--r-- | sys/src/cmd/mothra/html.h | 26 | ||||
-rw-r--r-- | sys/src/cmd/mothra/html.syntax.c | 25 | ||||
-rw-r--r-- | sys/src/cmd/mothra/rdhtml.c | 7 |
4 files changed, 45 insertions, 21 deletions
diff --git a/sys/src/cmd/mothra/forms.c b/sys/src/cmd/mothra/forms.c index cc246381c..76a4ae1a6 100644 --- a/sys/src/cmd/mothra/forms.c +++ b/sys/src/cmd/mothra/forms.c @@ -178,14 +178,16 @@ void rdform(Hglob *g){ f->type=TYPEIN; if(cistrcmp(s, "password")==0) f->type=PASSWD; + + s=f->name; + if(s && cistrcmp(s, "isindex")==0) + f->type=INDEX; + /* * If there's exactly one attribute, use its value as the name, * regardless of the attribute name. This makes * http://linus.att.com/ias/puborder.html work. */ - s=f->name; - if(s && cistrcmp(s, "isindex")==0) - f->type=INDEX; if(s==0){ if(g->attr[0].name && g->attr[1].name==0) f->name=strdup(g->attr[0].value); diff --git a/sys/src/cmd/mothra/html.h b/sys/src/cmd/mothra/html.h index ad287ef8b..61bc963a3 100644 --- a/sys/src/cmd/mothra/html.h +++ b/sys/src/cmd/mothra/html.h @@ -119,8 +119,13 @@ enum{ */ enum{ Tag_comment, + Tag_a, + Tag_abbr, + Tag_acronym, Tag_address, + Tag_applet, + Tag_audio, Tag_b, Tag_base, Tag_blockquot, @@ -136,8 +141,10 @@ enum{ Tag_dl, Tag_dt, Tag_em, + Tag_embed, Tag_font, Tag_form, + Tag_frame, /* rm 5.8.97 */ Tag_h1, Tag_h2, Tag_h3, @@ -148,6 +155,7 @@ enum{ Tag_hr, Tag_html, Tag_i, + Tag_iframe, Tag_img, Tag_input, Tag_isindex, @@ -159,31 +167,31 @@ enum{ Tag_menu, Tag_meta, Tag_nextid, + Tag_object, Tag_ol, Tag_option, Tag_p, Tag_plaintext, Tag_pre, Tag_samp, + Tag_script, Tag_select, Tag_strong, + Tag_style, + Tag_source, + Tag_table, /* rm 3.8.00 */ + Tag_td, Tag_textarea, Tag_title, + Tag_tr, Tag_tt, Tag_u, Tag_ul, Tag_var, - Tag_xmp, - Tag_frame, /* rm 5.8.97 */ - Tag_table, /* rm 3.8.00 */ - Tag_td, - Tag_tr, Tag_video, - Tag_object, - Tag_script, - Tag_style, - Tag_end, /* also used to indicate unrecognized start tag */ + Tag_xmp, + Tag_end, /* also used to indicate unrecognized start tag */ Tag_text, }; enum{ diff --git a/sys/src/cmd/mothra/html.syntax.c b/sys/src/cmd/mothra/html.syntax.c index 5f1e459d2..a1297149c 100644 --- a/sys/src/cmd/mothra/html.syntax.c +++ b/sys/src/cmd/mothra/html.syntax.c @@ -6,9 +6,12 @@ #include "mothra.h" #include "html.h" Tag tag[]={ -[Tag_comment] "!--", NOEND, [Tag_a] "a", END, +[Tag_abbr] "abbr", END, +[Tag_acronym] "acronym", END, [Tag_address] "address", END, +[Tag_applet] "applet", NOEND, +[Tag_audio] "audio", NOEND, [Tag_b] "b", END, [Tag_base] "base", NOEND, [Tag_blockquot] "blockquote", END, @@ -18,14 +21,18 @@ Tag tag[]={ [Tag_center] "center", END, [Tag_cite] "cite", END, [Tag_code] "code", END, +[Tag_comment] "!--", NOEND, [Tag_dd] "dd", NOEND, /* OPTEND */ [Tag_dfn] "dfn", END, [Tag_dir] "dir", END, [Tag_dl] "dl", END, [Tag_dt] "dt", NOEND, /* OPTEND */ [Tag_em] "em", END, +[Tag_embed] "embed", NOEND, +[Tag_end] 0, ERR, [Tag_font] "font", END, [Tag_form] "form", END, +[Tag_frame] "frame", NOEND, [Tag_h1] "h1", END, [Tag_h2] "h2", END, [Tag_h3] "h3", END, @@ -36,8 +43,9 @@ Tag tag[]={ [Tag_hr] "hr", NOEND, [Tag_html] "html", END, /* OPTEND */ [Tag_i] "i", END, -[Tag_input] "input", NOEND, +[Tag_iframe] "iframe", NOEND, [Tag_img] "img", NOEND, +[Tag_input] "input", NOEND, [Tag_isindex] "isindex", NOEND, [Tag_kbd] "kbd", END, [Tag_key] "key", END, @@ -47,20 +55,20 @@ Tag tag[]={ [Tag_menu] "menu", END, [Tag_meta] "meta", NOEND, [Tag_nextid] "nextid", NOEND, +[Tag_object] "object", END, [Tag_ol] "ol", END, [Tag_option] "option", NOEND, /* OPTEND */ [Tag_p] "p", NOEND, /* OPTEND */ [Tag_plaintext] "plaintext", NOEND, [Tag_pre] "pre", END, [Tag_samp] "samp", END, -[Tag_video] "video", NOEND, -[Tag_object] "object", END, [Tag_script] "script", END, -[Tag_style] "style", END, [Tag_select] "select", END, [Tag_strong] "strong", END, -[Tag_table] "table", END, -[Tag_td] "td", END, +[Tag_style] "style", END, +[Tag_source] "source", NOEND, +[Tag_table] "table", END, +[Tag_td] "td", END, [Tag_textarea] "textarea", END, [Tag_title] "title", END, [Tag_tr] "tr", END, @@ -68,7 +76,6 @@ Tag tag[]={ [Tag_u] "u", END, [Tag_ul] "ul", END, [Tag_var] "var", END, +[Tag_video] "video", NOEND, [Tag_xmp] "xmp", END, -[Tag_frame] "frame", NOEND, -[Tag_end] 0, ERR, }; diff --git a/sys/src/cmd/mothra/rdhtml.c b/sys/src/cmd/mothra/rdhtml.c index 6cce1946d..941fb199c 100644 --- a/sys/src/cmd/mothra/rdhtml.c +++ b/sys/src/cmd/mothra/rdhtml.c @@ -729,8 +729,12 @@ void plrdhtml(char *name, int fd, Www *dst){ g.linebrk=1; g.spacc=0; break; + case Tag_source: case Tag_video: + case Tag_audio: + case Tag_embed: case Tag_frame: + case Tag_iframe: if(str=pl_getattr(g.attr, "src")) strncpy(g.state->link, str, sizeof(g.state->link)); if(str=pl_getattr(g.attr, "name")) @@ -780,6 +784,7 @@ void plrdhtml(char *name, int fd, Www *dst){ /* more to come */ break; case Tag_cite: + case Tag_acronym: g.state->font=ITALIC; g.state->size=NORMAL; break; @@ -795,6 +800,7 @@ void plrdhtml(char *name, int fd, Www *dst){ break; case Tag_dfn: htmlerror(g.name, g.lineno, "<dfn> deprecated"); + case Tag_abbr: g.state->font=BOLD; g.state->size=NORMAL; break; @@ -940,6 +946,7 @@ void plrdhtml(char *name, int fd, Www *dst){ break; case Tag_script: case Tag_object: + case Tag_applet: case Tag_style: /* * ignore the content of these tags, eat tokens until we |