commit 70838ef2965acda617ce7acb752d1d5afe15166a
parent 76c27d83954eb535fe1dd8d961d01a59da4f941d
Author: ukai <ukai>
Date: Fri, 6 Dec 2002 16:49:18 +0000
[w3m-dev 03536] <del>, <s>
* file.c (HTMLtagproc1): <s>..</s> is [S:...:S]
(HTMLtagproc0): <del> will delete <table>
* fm.h (RB_S): added
* html.c (TagMAP): <s>,</s>
move <internal>, </internal>
* html.h (HTML_S): added
(HTML_N_S): added
(HTML_INTERNAL): renumed
(HTML_N_INTERNAL): ditto
(MAX_HTMLTAG): add 2
* rc.c (CMT_DISP_INS_DEL): update
* table.c (feed_table_tag): add HTML_S, HTML_N_S
* table.h (TBLM_S): added
(TBLM_ANCHOR): renum
* tagtable.tab: (strike, s): HTML_S
(/strike, /s): HTML_N_S
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat:
9 files changed, 71 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,25 @@
2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03536] <del>, <s>
+ * file.c (HTMLtagproc1): <s>..</s> is [S:...:S]
+ (HTMLtagproc0): <del> will delete <table>
+ * fm.h (RB_S): added
+ * html.c (TagMAP): <s>,</s>
+ move <internal>, </internal>
+ * html.h (HTML_S): added
+ (HTML_N_S): added
+ (HTML_INTERNAL): renumed
+ (HTML_N_INTERNAL): ditto
+ (MAX_HTMLTAG): add 2
+ * rc.c (CMT_DISP_INS_DEL): update
+ * table.c (feed_table_tag): add HTML_S, HTML_N_S
+ * table.h (TBLM_S): added
+ (TBLM_ANCHOR): renum
+ * tagtable.tab: (strike, s): HTML_S
+ (/strike, /s): HTML_N_S
+
+2002-12-07 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03535] close anchor, quote <
* file.c (HTMLtagproc1): close_anchor
* frame.c (createFrameFile): quote <
diff --git a/file.c b/file.c
@@ -4756,6 +4756,18 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
else
obuf->flag &= ~RB_DEL;
return 1;
+ case HTML_S:
+ if (displayInsDel)
+ HTMLlineproc1("<U>[S:</U>", h_env);
+ else
+ obuf->flag |= RB_S;
+ return 1;
+ case HTML_N_S:
+ if (displayInsDel)
+ HTMLlineproc1("<U>:S]</U>", h_env);
+ else
+ obuf->flag &= ~RB_S;
+ return 1;
case HTML_INS:
if (displayInsDel)
HTMLlineproc1("<U>[INS:</U>", h_env);
@@ -4765,17 +4777,17 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
HTMLlineproc1("<U>:INS]</U>", h_env);
return 1;
case HTML_SUP:
- if (!(obuf->flag & RB_DEL))
+ if (!(obuf->flag & (RB_DEL | RB_S)))
HTMLlineproc1("^", h_env);
return 1;
case HTML_N_SUP:
return 1;
case HTML_SUB:
- if (!(obuf->flag & RB_DEL))
+ if (!(obuf->flag & (RB_DEL | RB_S)))
HTMLlineproc1("[", h_env);
return 1;
case HTML_N_SUB:
- if (!(obuf->flag & RB_DEL))
+ if (!(obuf->flag & (RB_DEL | RB_S)))
HTMLlineproc1("]", h_env);
return 1;
case HTML_FONT:
@@ -5667,6 +5679,8 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
continue;
/* continue to the next */
}
+ if (obuf->flag & RB_DEL)
+ continue;
/* all tables have been read */
if (tbl->vspace > 0 && !(obuf->flag & RB_IGNORE_P)) {
int indent = h_env->envs[h_env->envc].indent;
@@ -5718,7 +5732,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal)
continue;
}
- if (obuf->flag & RB_DEL)
+ if (obuf->flag & (RB_DEL | RB_S))
continue;
while (*str) {
mode = get_mctype(str);
diff --git a/fm.h b/fm.h
@@ -582,6 +582,7 @@ struct readbuffer {
#define RB_FILL 0x80000
#endif /* FORMAT_NICE */
#define RB_DEL 0x100000
+#define RB_S 0x200000
#define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN)
#define RB_SET_ALIGN(obuf,align) {(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= (align); }
diff --git a/html.c b/html.c
@@ -226,11 +226,11 @@ TagInfo TagMAP[MAX_HTMLTAG] = {
{"sub", NULL, 0, 0}, /* 102 HTML_SUB */
{"/sub", NULL, 0, 0}, /* 103 HTML_N_SUB */
{"link", ALST_LINK, MAXA_LINK, 0}, /* 104 HTML_LINK */
- {NULL, NULL, 0, 0}, /* 105 Undefined */
+ {"s", NULL, 0, 0}, /* 105 HTML_S */
+ {"/s", NULL, 0, TFLG_END}, /* 106 HTML_N_S */
+ {NULL, NULL, 0, 0}, /* 107 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 */
@@ -252,6 +252,8 @@ TagInfo TagMAP[MAX_HTMLTAG] = {
{" ", ALST_NOP, MAXA_NOP, TFLG_INT}, /* 126 HTML_NOP */
{"pre_plain", NULL, 0, TFLG_INT}, /* 127 HTML_PRE_PLAIN */
{"/pre_plain", NULL, 0, TFLG_INT | TFLG_END}, /* 128 HTML_N_PRE_PLAIN */
+ {"internal", NULL, 0, TFLG_INT}, /* 129 HTML_INTERNAL */
+ {"/internal", NULL, 0, TFLG_INT | TFLG_END}, /* 130 HTML_N_INTERNAL */
};
TagAttrInfo AttrMAP[MAX_TAGATTR] = {
diff --git a/html.h b/html.h
@@ -191,10 +191,10 @@ typedef struct {
#define HTML_SUB 102
#define HTML_N_SUB 103
#define HTML_LINK 104
+#define HTML_S 105
+#define HTML_N_S 106
/* 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
@@ -216,8 +216,10 @@ typedef struct {
#define HTML_NOP 126
#define HTML_PRE_PLAIN 127
#define HTML_N_PRE_PLAIN 128
+#define HTML_INTERNAL 129
+#define HTML_N_INTERNAL 130
-#define MAX_HTMLTAG 129
+#define MAX_HTMLTAG 131
/* Tag attribute */
diff --git a/rc.c b/rc.c
@@ -81,7 +81,7 @@ static char *config_file = NULL;
#define CMT_MULTICOL "ファイル名のマルチカラム表示"
#define CMT_ALT_ENTITY "エンティティを ASCII の代替表現で表す"
#define CMT_FOLD_TEXTAREA "TEXTAREA の行を折り返して表示"
-#define CMT_DISP_INS_DEL "DEL タグの内容を表示する。"
+#define CMT_DISP_INS_DEL "DEL, S, STRIKE 要素の内容を表示する。"
#define CMT_COLOR "カラー表示"
#define CMT_B_COLOR "文字の色"
#define CMT_A_COLOR "アンカーの色"
@@ -236,7 +236,7 @@ static char *config_file = NULL;
#define CMT_MULTICOL "Display file names in multi-column format"
#define CMT_ALT_ENTITY "Use ASCII equivalents to display entities"
#define CMT_FOLD_TEXTAREA "Fold lines in TEXTAREA"
-#define CMT_DISP_INS_DEL "Display INS and DEL tag"
+#define CMT_DISP_INS_DEL "Display DEL, S and STRIKE element"
#define CMT_COLOR "Display with color"
#define CMT_B_COLOR "Color of normal character"
#define CMT_A_COLOR "Color of anchor"
diff --git a/table.c b/table.c
@@ -2980,6 +2980,18 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
else
mode->pre_mode &= ~TBLM_DEL;
break;
+ case HTML_S:
+ if (displayInsDel)
+ feed_table_inline_tag(tbl, line, mode, 3); /* [S: */
+ else
+ mode->pre_mode |= TBLM_S;
+ break;
+ case HTML_N_S:
+ if (displayInsDel)
+ feed_table_inline_tag(tbl, line, mode, 3); /* :S] */
+ else
+ mode->pre_mode &= ~TBLM_S;
+ break;
case HTML_INS:
case HTML_N_INS:
if (displayInsDel)
@@ -2988,7 +3000,7 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
case HTML_SUP:
case HTML_SUB:
case HTML_N_SUB:
- if (!(mode->pre_mode & TBLM_DEL))
+ if (!(mode->pre_mode & (TBLM_DEL | TBLM_S)))
feed_table_inline_tag(tbl, line, mode, 1); /* ^, [, ] */
break;
case HTML_N_SUP:
@@ -3118,7 +3130,7 @@ feed_table(struct table *tbl, char *line, struct table_mode *mode,
}
}
else {
- if (mode->pre_mode & TBLM_DEL)
+ if (mode->pre_mode & (TBLM_DEL | TBLM_S))
return -1;
}
if (mode->caption) {
diff --git a/table.h b/table.h
@@ -125,7 +125,8 @@ struct table {
#define TBLM_PREMODE (TBLM_PRE | TBLM_PRE_INT | TBLM_SCRIPT | TBLM_STYLE | TBLM_PLAIN | TBLM_INTXTA)
#define TBLM_SPECIAL (TBLM_PRE | TBLM_PRE_INT | TBLM_SCRIPT | TBLM_STYLE | TBLM_PLAIN | TBLM_NOBR)
#define TBLM_DEL RB_DEL
-#define TBLM_ANCHOR 0x200000
+#define TBLM_S RB_S
+#define TBLM_ANCHOR 0x1000000
#define uchar unsigned char
#define ushort unsigned short
diff --git a/tagtable.tab b/tagtable.tab
@@ -104,10 +104,10 @@ script HTML_SCRIPT
base HTML_BASE
del HTML_DEL
/del HTML_N_DEL
-strike HTML_DEL
-/strike HTML_N_DEL
-s HTML_DEL
-/s HTML_N_DEL
+strike HTML_S
+/strike HTML_N_S
+s HTML_S
+/s HTML_N_S
ins HTML_INS
/ins HTML_N_INS
u HTML_U