commit 8d2d1de8958917b67537cd2f438632905b6752fd
parent 8b84c1457147c136ae6c13af5cda3d4824c2f34c
Author: htrb <htrb>
Date: Mon, 19 Jul 2010 12:53:39 +0000
* [w3m-dev 04321] Re: w3m's bugs from bugs.debian.org
* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329863#8
* rc.c: Introduce option pseudo_inlines.
* fm.h: add global variable pseudoInlines.
* file.c (process_img): check q.
Diffstat:
4 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,6 +1,14 @@
2010-07-19 d+w3m@vdr.jp
* [w3m-dev 04321] Re: w3m's bugs from bugs.debian.org
+ * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329863#8
+ * rc.c: Introduce option pseudo_inlines.
+ * fm.h: add global variable pseudoInlines.
+ * file.c (process_img): check q.
+
+2010-07-19 d+w3m@vdr.jp
+
+ * [w3m-dev 04321] Re: w3m's bugs from bugs.debian.org
* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537706#10
* rc.c (interpret_rc): check line->length before call Strchop().
diff --git a/file.c b/file.c
@@ -3224,6 +3224,13 @@ process_img(struct parsed_tag *tag, int width)
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
@@ -948,6 +948,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
@@ -75,6 +75,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")
@@ -385,6 +386,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,