Description: New option "pseudo_inlines" Add option pseudo_inlines (Display pseudo-ALTs for inline images with no ALT or TITLE string) so w3m -o pseudo_inlines=0 works like lynx -pseudo_inlines If there is no ALT tag or it is "" and ignore_null_img_alt=1 then use TITLE instead. Origin: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329863#8 Author: Karsten Schoelzel Bug-Debian: http://bugs.debian.org/329863 --- commit 1c2e64c5ba38727f991c9787b95067391a4a0907 tree 292b46472454ad69dee708029915cef0b0a718da parent 1e6c13cac0c2954de5c377fe2120710c7c2b30fe author Karsten Schoelzel Thu, 04 May 2006 13:05:03 +0200 committer Karsten Schoelzel Thu, 04 May 2006 13:05:03 +0200 file.c | 7 +++++++ fm.h | 1 + rc.c | 3 +++ 3 files changed, 11 insertions(+), 0 deletions(-) diff --git a/file.c b/file.c index d067d47..913ac7c 100644 --- a/file.c +++ b/file.c @@ -3171,6 +3171,13 @@ process_img(struct parsed_tag *tag, int parsedtag_get_value(tag, ATTR_ALT, &q); t = q; parsedtag_get_value(tag, ATTR_TITLE, &t); + if (q == NULL || (*q == '\0' && ignore_null_img_alt)) { + if (!pseudoInlines && (t == NULL || + (*t == '\0' && ignore_null_img_alt))) + return tmp; + q = t; + } + w = -1; if (parsedtag_get_value(tag, ATTR_WIDTH, &w)) { if (w < 0) { diff --git a/fm.h b/fm.h index a593a3f..e10c2a7 100644 --- a/fm.h +++ b/fm.h @@ -926,6 +926,7 @@ global int image_map_list init(TRUE); #else global int displayImage init(FALSE); /* XXX: emacs-w3m use display_image=off */ #endif +global int pseudoInlines init(TRUE); global char *Editor init(DEF_EDITOR); #ifdef USE_W3MMAILER global char *Mailer init(NULL); diff --git a/rc.c b/rc.c index 2860a35..5d009bb 100644 --- a/rc.c +++ b/rc.c @@ -76,6 +76,7 @@ static int OptionEncode = FALSE; #define CMT_DECODE_URL N_("Display decoded URL") #define CMT_DISPLINEINFO N_("Display current line number") #define CMT_DISP_IMAGE N_("Display inline images") +#define CMT_PSEUDO_INLINES N_("Display pseudo-ALTs for inline images with no ALT or TITLE string") #ifdef USE_IMAGE #define CMT_AUTO_IMAGE N_("Load inline images automatically") #define CMT_MAX_LOAD_IMAGE N_("Maximum processes for parallel image loading") @@ -380,6 +381,8 @@ struct param_ptr params1[] = { /* XXX: emacs-w3m force to off display_image even if image options off */ {"display_image", P_INT, PI_ONOFF, (void *)&displayImage, CMT_DISP_IMAGE, NULL}, + {"pseudo_inlines", P_INT, PI_ONOFF, (void *)&pseudoInlines, + CMT_PSEUDO_INLINES, NULL}, #ifdef USE_IMAGE {"auto_image", P_INT, PI_ONOFF, (void *)&autoImage, CMT_AUTO_IMAGE, NULL}, {"max_load_image", P_INT, PI_TEXT, (void *)&maxLoadImage,