w3m

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

commit fd56cbb434563d991eef762da9856b7fa6c67467
parent 831d86cdcb64b8cee167f980fd27d2f778af94f6
Author: ukai <ukai>
Date:   Mon, 25 Nov 2002 16:39:52 +0000

[w3m-dev 03476] Re: Bug#170506: w3m: Unable to use mozilla bugzilla
* file.c (HTMLtagproc1): initialize ignore_tag in table_mode
	(HTMLtagproc0): check table_level
* table.c (feed_table_tag): set mode->ignore_tag
* table.h (struct table_mode): add ignore_tag
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>

Diffstat:
MChangeLog | 8++++++++
Mfile.c | 14++++++++++----
Mtable.c | 2++
Mtable.h | 1+
4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,11 @@ +2002-11-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03476] Re: Bug#170506: w3m: Unable to use mozilla bugzilla + * file.c (HTMLtagproc1): initialize ignore_tag in table_mode + (HTMLtagproc0): check table_level + * table.c (feed_table_tag): set mode->ignore_tag + * table.h (struct table_mode): add ignore_tag + 2002-11-25 Fumitoshi UKAI <ukai@debian.or.jp> * [w3m-dev 03471] Re: SETPGRP() diff --git a/file.c b/file.c @@ -4467,6 +4467,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) table_mode[obuf->table_level].indent_level = 0; table_mode[obuf->table_level].nobr_level = 0; table_mode[obuf->table_level].caption = 0; + table_mode[obuf->table_level].ignore_tag = NULL; #ifndef TABLE_EXPAND tables[obuf->table_level]->total_width = width; #else @@ -5452,7 +5453,8 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal) read_token(h_env->tagbuf, &str, &obuf->status, pre_mode, 0); } if (ST_IS_COMMENT(obuf->status)) { - if (obuf->flag & RB_IGNORE) + if ((obuf->table_level >= 0) ? tbl_mode->pre_mode & TBLM_IGNORE + : obuf->flag & RB_IGNORE) /* within ignored tag, such as * * <script>..</script>, don't process comment. */ obuf->status = R_ST_NORMAL; @@ -5467,9 +5469,13 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal) if (ST_IS_REAL_TAG(obuf->status)) Strcat_char(h_env->tagbuf, ' '); } - if ((obuf->flag & RB_IGNORE) && - !TAG_IS(h_env->tagbuf->ptr, obuf->ignore_tag->ptr, - obuf->ignore_tag->length - 1)) + if ((obuf->table_level >= 0) + ? ((tbl_mode->pre_mode & TBLM_IGNORE) && + !TAG_IS(h_env->tagbuf->ptr, tbl_mode->ignore_tag->ptr, + tbl_mode->ignore_tag->length - 1)) + : ((obuf->flag & RB_IGNORE) && + !TAG_IS(h_env->tagbuf->ptr, obuf->ignore_tag->ptr, + obuf->ignore_tag->length - 1))) /* within ignored tag, such as * * <script>..</script>, don't process tag. */ obuf->status = R_ST_NORMAL; diff --git a/table.c b/table.c @@ -2969,9 +2969,11 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, break; case HTML_SCRIPT: mode->pre_mode |= TBLM_SCRIPT; + mode->ignore_tag = Strnew_charp("</script>"); break; case HTML_STYLE: mode->pre_mode |= TBLM_STYLE; + mode->ignore_tag = Strnew_charp("</style>"); break; case HTML_N_A: table_close_anchor0(tbl, mode); diff --git a/table.h b/table.h @@ -139,6 +139,7 @@ struct table_mode { short nobr_offset; char nobr_level; short anchor_offset; + Str ignore_tag; }; /* Local Variables: */