diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-09 15:40:34 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-09 15:40:34 +0000 |
commit | 4c89fd63aaf6921ef9b627bf792680d2fea6c4f1 (patch) | |
tree | 3c022dbe0e0ea957e7460fa38e132ccafcf3b36f | |
parent | [w3m-dev 03544] Can't display "1&2" in table (diff) | |
download | w3m-4c89fd63aaf6921ef9b627bf792680d2fea6c4f1.tar.gz w3m-4c89fd63aaf6921ef9b627bf792680d2fea6c4f1.zip |
[w3m-dev 03548] close anchor before <img align=...>
* file.c (process_img): use div_int
(process_hr): use div_int
(process_idattr): don't close_anchor
(CLOSE_A): added
(HTMLtagproc1): </p> close anchor
<dl>,<ul>,<ol>,<blockquote>,<li>,<dt>,<dd> close anchor
<noframes> close anchor
<pre> close anchor
<center> close anchor
<div> close anchor
add DIV_INT
<form> close anchor
* html.c (TagMAP): add div_int
* html.h (HTML_DIV_INT): added
(HTML_N_DIV_INT): added
* tagtable.tab (div_int): added
(/div_int): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | file.c | 76 | ||||
-rw-r--r-- | html.c | 4 | ||||
-rw-r--r-- | html.h | 6 | ||||
-rw-r--r-- | tagtable.tab | 2 |
5 files changed, 74 insertions, 37 deletions
@@ -1,5 +1,26 @@ 2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03548] close anchor before <img align=...> + * file.c (process_img): use div_int + (process_hr): use div_int + (process_idattr): don't close_anchor + (CLOSE_A): added + (HTMLtagproc1): </p> close anchor + <dl>,<ul>,<ol>,<blockquote>,<li>,<dt>,<dd> close anchor + <noframes> close anchor + <pre> close anchor + <center> close anchor + <div> close anchor + add DIV_INT + <form> close anchor + * html.c (TagMAP): add div_int + * html.h (HTML_DIV_INT): added + (HTML_N_DIV_INT): added + * tagtable.tab (div_int): added + (/div_int): added + +2002-12-10 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03544] Can't display "1&2" in table * file.c (HTMLlineproc0): continue -> R_ST_NORMAL @@ -5611,4 +5632,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.604 2002/12/09 15:33:33 ukai Exp $ +$Id: ChangeLog,v 1.605 2002/12/09 15:40:34 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.156 2002/12/09 15:33:34 ukai Exp $ */ +/* $Id: file.c,v 1.157 2002/12/09 15:40:35 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -2992,13 +2992,13 @@ process_img(struct parsed_tag *tag, int width) if (use_image) { switch (align) { case ALIGN_LEFT: - Strcat_charp(tmp, "<div align=left>"); + Strcat_charp(tmp, "<div_int align=left>"); break; case ALIGN_CENTER: - Strcat_charp(tmp, "<div align=center>"); + Strcat_charp(tmp, "<div_int align=center>"); break; case ALIGN_RIGHT: - Strcat_charp(tmp, "<div align=right>"); + Strcat_charp(tmp, "<div_int align=right>"); break; } } @@ -3225,7 +3225,7 @@ process_img(struct parsed_tag *tag, int width) case ALIGN_RIGHT: case ALIGN_CENTER: case ALIGN_LEFT: - Strcat_charp(tmp, "</div>"); + Strcat_charp(tmp, "</div_int>"); break; } } @@ -3708,13 +3708,13 @@ process_hr(struct parsed_tag *tag, int width, int indent_width) parsedtag_get_value(tag, ATTR_ALIGN, &x); switch (x) { case ALIGN_CENTER: - Strcat_charp(tmp, "<div align=center>"); + Strcat_charp(tmp, "<div_int align=center>"); break; case ALIGN_RIGHT: - Strcat_charp(tmp, "<div align=right>"); + Strcat_charp(tmp, "<div_int align=right>"); break; case ALIGN_LEFT: - Strcat_charp(tmp, "<div align=left>"); + Strcat_charp(tmp, "<div_int align=left>"); break; } #ifndef KANJI_SYMBOLS @@ -3729,7 +3729,7 @@ process_hr(struct parsed_tag *tag, int width, int indent_width) #ifndef KANJI_SYMBOLS Strcat_charp(tmp, "</_RULE>"); #endif /* not KANJI_SYMBOLS */ - Strcat_charp(tmp, "</div></nobr>"); + Strcat_charp(tmp, "</div_int></nobr>"); return tmp; } @@ -3924,10 +3924,13 @@ process_idattr(struct readbuffer *obuf, int cmd, struct parsed_tag *tag) #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);\ - close_anchor(h_env, obuf);\ obuf->flag &= ~RB_P;\ } +#define CLOSE_A \ + CLOSE_P; \ + close_anchor(h_env, obuf); + #define CLOSE_DT \ if (obuf->flag & RB_IN_DT) { \ obuf->flag &= ~RB_IN_DT; \ @@ -4067,7 +4070,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) return 1; case HTML_P: case HTML_N_P: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 1, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, @@ -4105,7 +4108,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_UL: case HTML_OL: case HTML_BLQ: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); if (!(obuf->flag & RB_PREMODE) && @@ -4134,7 +4137,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_N_DL: case HTML_N_BLQ: CLOSE_DT; - CLOSE_P; + CLOSE_A; if (h_env->envc > 0) { flushline(h_env, obuf, envs[h_env->envc - 1].indent, 0, h_env->limit); @@ -4150,7 +4153,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) close_anchor(h_env, obuf); return 1; case HTML_DL: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); if (!(obuf->flag & RB_PREMODE)) @@ -4163,7 +4166,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) obuf->flag |= RB_IGNORE_P; return 1; case HTML_LI: - CLOSE_P; + CLOSE_A; CLOSE_DT; if (h_env->envc > 0) { Str num; @@ -4242,7 +4245,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) obuf->flag |= RB_IGNORE_P; return 1; case HTML_DT: - CLOSE_P; + CLOSE_A; if (h_env->envc == 0 || (h_env->envc_real < h_env->nenv && envs[h_env->envc].env != HTML_DL && @@ -4260,7 +4263,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) obuf->flag |= RB_IGNORE_P; return 1; case HTML_DD: - CLOSE_P; + CLOSE_A; CLOSE_DT; if (envs[h_env->envc].env == HTML_DL_COMPACT) { if (obuf->pos > envs[h_env->envc].indent) @@ -4309,13 +4312,13 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) } return 0; case HTML_NOFRAMES: - CLOSE_P; + CLOSE_A; flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag |= (RB_NOFRAMES | RB_IGNORE_P); /* istr = str; */ return 1; case HTML_N_NOFRAMES: - CLOSE_P; + CLOSE_A; flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag &= ~RB_NOFRAMES; return 1; @@ -4342,8 +4345,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) return 1; case HTML_PRE: x = parsedtag_exists(tag, ATTR_FOR_TABLE); - if (!x) - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); if (!x) @@ -4353,7 +4355,6 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) else fillline(obuf, envs[h_env->envc].indent); obuf->flag |= (RB_PRE | RB_IGNORE_P); - close_anchor(h_env, obuf); /* istr = str; */ return 1; case HTML_N_PRE: @@ -4393,17 +4394,16 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) obuf->flag &= ~RB_NOBR; return 0; case HTML_PRE_PLAIN: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); } obuf->flag |= (RB_PRE | RB_IGNORE_P); - close_anchor(h_env, obuf); return 1; case HTML_N_PRE_PLAIN: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, @@ -4415,7 +4415,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_LISTING: case HTML_XMP: case HTML_PLAINTEXT: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, @@ -4433,11 +4433,10 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) obuf->end_tag = MAX_HTMLTAG; break; } - close_anchor(h_env, obuf); return 1; case HTML_N_LISTING: case HTML_N_XMP: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, @@ -4588,31 +4587,42 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) /* should be processed in HTMLlineproc() */ return 1; case HTML_CENTER: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & (RB_PREMODE | RB_IGNORE_P))) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); RB_SAVE_FLAG(obuf); RB_SET_ALIGN(obuf, RB_CENTER); return 1; case HTML_N_CENTER: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_PREMODE)) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); RB_RESTORE_FLAG(obuf); return 1; case HTML_DIV: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); set_alignment(obuf, tag); return 1; case HTML_N_DIV: + CLOSE_A; + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + RB_RESTORE_FLAG(obuf); + return 1; + case HTML_DIV_INT: + CLOSE_P; + if (!(obuf->flag & RB_IGNORE_P)) + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + set_alignment(obuf, tag); + return 1; + case HTML_N_DIV_INT: CLOSE_P; flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); RB_RESTORE_FLAG(obuf); return 1; case HTML_FORM: - CLOSE_P; + CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); tmp = process_form(tag); @@ -4620,7 +4630,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) HTMLlineproc1(tmp->ptr, h_env); return 1; case HTML_N_FORM: - CLOSE_P; + CLOSE_A; flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag |= RB_IGNORE_P; process_n_form(); @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.21 2002/12/08 14:23:44 ukai Exp $ */ +/* $Id: html.c,v 1.22 2002/12/09 15:40:36 ukai Exp $ */ #include "html.h" /* Define HTML Tag Infomation Table */ @@ -254,6 +254,8 @@ TagInfo TagMAP[MAX_HTMLTAG] = { {"/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 */ + {"div_int", ALST_P, MAXA_P, TFLG_INT}, /* 131 HTML_DIV_INT */ + {"/div_int", NULL, 0, TFLG_INT | TFLG_END}, /* 132 HTML_N_DIV_INT */ }; TagAttrInfo AttrMAP[MAX_TAGATTR] = { @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.14 2002/12/06 16:50:28 ukai Exp $ */ +/* $Id: html.h,v 1.15 2002/12/09 15:40:37 ukai Exp $ */ #ifndef _HTML_H #define _HTML_H #ifdef USE_SSL @@ -218,8 +218,10 @@ typedef struct { #define HTML_N_PRE_PLAIN 128 #define HTML_INTERNAL 129 #define HTML_N_INTERNAL 130 +#define HTML_DIV_INT 131 +#define HTML_N_DIV_INT 132 -#define MAX_HTMLTAG 131 +#define MAX_HTMLTAG 133 /* Tag attribute */ diff --git a/tagtable.tab b/tagtable.tab index f421aa0..7bff629 100644 --- a/tagtable.tab +++ b/tagtable.tab @@ -168,3 +168,5 @@ textarea_int HTML_TEXTAREA_INT /textarea_int HTML_N_TEXTAREA_INT pre_plain HTML_PRE_PLAIN /pre_plain HTML_N_PRE_PLAIN +div_int HTML_DIV_INT +/div_int HTML_N_DIV_INT |