git: 9front

Download patch

ref: ca6de94a1e034beb3ba5c840ab4e28abe75620fb
parent: 72b7a3323632a99eee9fd9cc8cc6c0dd9233d112
author: cinap_lenrek <cinap_lenrek@rei2.9hal>
date: Sun Nov 6 11:13:46 EST 2011

mothra: more tags

--- a/sys/src/cmd/mothra/forms.c
+++ b/sys/src/cmd/mothra/forms.c
@@ -178,14 +178,16 @@
 			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);
--- a/sys/src/cmd/mothra/html.h
+++ b/sys/src/cmd/mothra/html.h
@@ -119,8 +119,13 @@
  */
 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 @@
 	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 @@
 	Tag_hr,
 	Tag_html,
 	Tag_i,
+	Tag_iframe,
 	Tag_img,
 	Tag_input,
 	Tag_isindex,
@@ -159,6 +167,7 @@
 	Tag_menu,
 	Tag_meta,
 	Tag_nextid,
+	Tag_object,
 	Tag_ol,
 	Tag_option,
 	Tag_p,
@@ -165,25 +174,24 @@
 	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{
--- 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,6 +21,7 @@
 [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,
@@ -24,8 +28,11 @@
 [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_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,6 +55,7 @@
 [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 */
@@ -53,14 +62,13 @@
 [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_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,
 };
--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -729,8 +729,12 @@
 			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 @@
 			/* more to come */
 			break;
 		case Tag_cite:
+		case Tag_acronym:
 			g.state->font=ITALIC;
 			g.state->size=NORMAL;
 			break;
@@ -795,6 +800,7 @@
 			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 @@
 			break;
 		case Tag_script:
 		case Tag_object:
+		case Tag_applet:
 		case Tag_style:
 			/*
 			 * ignore the content of these tags, eat tokens until we
--