w3m

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

commit 98e0e43d4f0905fb113d621d06bdfe2ac30fe358
parent 5b8039d001f29b340271e5f6dfdabf50da9316cb
Author: inu <inu>
Date:   Thu, 19 Apr 2007 12:00:37 +0000

avoid conflicts between input_alt and img_alt, and fix calculation of labeled line numbers when fold_line=1. [w3m-dev 04211]

Diffstat:
MChangeLog | 6++++++
Mfile.c | 10++++++----
Mhtml.c | 5+++--
Mhtml.h | 3++-
4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-19 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 04211] input type=image + * file.c, html.[ch]: avoid conflicts between input_alt and img_alt. + fix calculation of labeled line numbers when fold_line=1. + 2007-04-19 Hiroyuki Ito <ZXB01226@nifty.com> * [w3m-dev 04197] Re: italic text diff --git a/file.c b/file.c @@ -2250,7 +2250,7 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, } else { /* plain text */ int l = atoi(pu.label); - gotoLine(b, l); + gotoRealLine(b, l); b->pos = 0; arrangeCursor(b); } @@ -3161,7 +3161,7 @@ process_img(struct parsed_tag *tag, int width) #else int w, i, nw, n; #endif - int pre_int = FALSE; + int pre_int = FALSE, ext_pre_int = FALSE; Str tmp = Strnew(); if (!parsedtag_get_value(tag, ATTR_SRC, &p)) @@ -3217,6 +3217,8 @@ process_img(struct parsed_tag *tag, int width) parsedtag_get_value(tag, ATTR_HEIGHT, &i); r = NULL; parsedtag_get_value(tag, ATTR_USEMAP, &r); + if (parsedtag_exists(tag, ATTR_PRE_INT)) + ext_pre_int = TRUE; tmp = Strnew_size(128); #ifdef USE_IMAGE @@ -3445,7 +3447,7 @@ process_img(struct parsed_tag *tag, int width) } #endif Strcat_charp(tmp, "</img_alt>"); - if (pre_int) + if (pre_int && !ext_pre_int) Strcat_charp(tmp, "</pre_int>"); if (r) { Strcat_charp(tmp, "</input_alt>"); @@ -3584,7 +3586,7 @@ process_input(struct parsed_tag *tag) Strcat(tmp, Sprintf(" width=\"%d\"", iw)); if (parsedtag_get_value(tag, ATTR_HEIGHT, &ih)) Strcat(tmp, Sprintf(" height=\"%d\"", ih)); - Strcat_charp(tmp, ">"); + Strcat_charp(tmp, " pre_int>"); Strcat_charp(tmp, "</input_alt></pre_int>"); return tmp; } diff --git a/html.c b/html.c @@ -29,9 +29,9 @@ unsigned char ALST_PRE[] = { ATTR_FOR_TABLE, ATTR_CORE }; #define MAXA_PRE MAXA_CORE + 1 unsigned char ALST_IMG[] = { ATTR_SRC, ATTR_ALT, ATTR_WIDTH, ATTR_HEIGHT, ATTR_ALIGN, ATTR_USEMAP, - ATTR_ISMAP, ATTR_TITLE, ATTR_CORE + ATTR_ISMAP, ATTR_TITLE, ATTR_PRE_INT, ATTR_CORE }; -#define MAXA_IMG MAXA_CORE + 8 +#define MAXA_IMG MAXA_CORE + 9 unsigned char ALST_TABLE[] = { ATTR_BORDER, ATTR_WIDTH, ATTR_HBORDER, ATTR_CELLSPACING, ATTR_CELLPADDING, ATTR_VSPACE, ATTR_CORE @@ -348,4 +348,5 @@ TagAttrInfo AttrMAP[MAX_TAGATTR] = { {"referer", VTYPE_STR, AFLG_INT}, /* 71 ATTR_REFERER */ {"selectnumber", VTYPE_NUMBER, AFLG_INT}, /* 72 ATTR_SELECTNUMBER */ {"textareanumber", VTYPE_NUMBER, AFLG_INT}, /* 73 ATTR_TEXTAREANUMBER */ + {"pre_int", VTYPE_NONE, AFLG_INT}, /* 74 ATTR_PRE_INT */ }; diff --git a/html.h b/html.h @@ -301,8 +301,9 @@ typedef struct { #define ATTR_REFERER 71 #define ATTR_SELECTNUMBER 72 #define ATTR_TEXTAREANUMBER 73 +#define ATTR_PRE_INT 74 -#define MAX_TAGATTR 74 +#define MAX_TAGATTR 75 /* HTML Tag Information Table */