package w3m
tag 329863 patch
thanks

On Sat, Sep 24, 2005 at 01:25:22AM +0800, Dan Jacobson wrote:
> Package: w3m
> Version: 0.5.1-4
> Severity: minor
> 
> No matter what I do, e.g., -o ignore_null_img_alt=1, I cannot find an
> option to make this
>   <P><IMG src="images/default_02.jpg"></P>
> not show up as
> [default_02]
> when viewing or with -dump.  There is no way to get rid of it.
> I don't want to see it in certain -dump's.
> 
> In lynx all I need to do is
> $ lynx -dump -pseudo_inlines file.html
> 
Hi,

the attached patch adds a 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

Regards,
-- 
Karsten Schölzel        | Email:  [EMAIL PROTECTED]
Väderleden 9 4:98       | Jabber: [EMAIL PROTECTED]
97633 Luleå             | VoIP:   sip:[EMAIL PROTECTED]
Sweden                  |         sip:[EMAIL PROTECTED]
                        | Tel:    +4918015855857712
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.

---
commit 1c2e64c5ba38727f991c9787b95067391a4a0907
tree 292b46472454ad69dee708029915cef0b0a718da
parent 1e6c13cac0c2954de5c377fe2120710c7c2b30fe
author Karsten Schoelzel <[EMAIL PROTECTED]> Thu, 04 May 2006 13:05:03 +0200
committer Karsten Schoelzel <[EMAIL PROTECTED]> 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,

Reply via email to