Cameron Simpson wrote:

> On 26Jun2014 13:55, raf <m...@raf.org> wrote:
> >i used to have this in my mutt mailcap file:
> >
> >   text/html; lynx -dump %s; copiousoutput
> >
> >and it was good. it formatted the html and gave me a list of
> >referenced urls at the bottom.
> >
> >for some reason i can't remember, i changed it to:
> >
> >   text/html; w3m -I %{charset} -T text/html -dump; copiousoutput;
> >
> >which does the formatting but doesn't give a list of referenced urls
> >at the bottom so it's less useful.
> >
> >if i change it back to using the "lynx -dump" command then i see the
> >raw html instead of the formatted html (as though i'd used "lynx -source"
> >rather than "lynx -dump").
> >
> >i suspect that must be why i changed it to use w3m in the past.
> >
> >anyway, if i save the html attachment and run lynx -dump on it
> >then it shows me the formatting page with the list of referenced
> >urls like it used to but that isn't what happens when mutt invokes
> >the same command when autoviewing the attachment.
> >
> >does anyone have any idea why this might be the case or what i can
> >do to make lynx work again for autoviewing html in mutt?
> 
> I would do two things:
> 
> First: inspect the message. Is the HTML attachment actually marked
> as "text/html" as its content-type? If not, the wrong filter (if
> any) will be chosen from your mailcap file. For example, if the
> contenttype header for the attachment is text/plain, mutt will
> (correctly) transcribe the HTML unformatted.

mutt is invoking the text/html autoview command. it says this at the top:

  [-- Autoview using lynx -dump '/tmp/muttRpvZEI' --]

> Second: if the message has the HTML marked as text/html, check that
> the correct line is being selected from your mailcap file. I would be
> inclined to make a shell script (mine is called "unhtml") and put the
> lynx (or w3m) incantation inside it. Then hack the script:
> 
>   #!/bin/sh
>   exec 2>>$HOME/unhtml.err
>   set -vx
>   lynx -dump ${1+"$@"}
> 
> Then "tail -F" the unhtml.err file to check that your script is being fired.

i did that and it showed no unexpected output.

> Cheers,
> Cameron Simpson <c...@zip.com.au>

adding -force_html to the command did fix the problem. yay!

thanks everyone.

cheers,
raf

Reply via email to