On Wed, Aug 06, 2008 at 17:58:48 +0100, Lars Hecking wrote: > w3m <filename> views the file like any other web browser. > > -dump dumps a formatted version of the page to stdout, so you lose all > hyperlinks.
I use the attached lines in my ~/.mailcap to use w3m as an HTML viewer. I also have another entry (earlier within mailcap, not attached here) which tests for a display and starts w3m in a separate xterm. One rule "dump"s the rendered HTML page in the mail view, which is very often sufficient If I want to open it in a browsable way (with the requested hyperlinks), I press "v" (<view-attachments>) and press return (<view-attach>) on the HTML attachment. Let me capture this thread and ask a question: How can mutt tell w3m which charset to use? In the attached mailcap, I force ISO-8859-1, but that's just a hack. In true honesty, I get some ISO and some UTF-8 coded HTML attachments. Assuming the attachment is correctly MIME-denoted in the header (which is mostly the case), how can I pass this on to w3m? Any ideas? Thanks, Moritz
text/html; w3m -T text/html -I ISO-8859-1 -o frame=0 -o meta_refresh=0 -o auto_image=0 %s; needsterminal; \ description=HTML Text; nametemplate=%s.html text/html; w3m -T text/html -I ISO-8859-1 -o frame=0 -o meta_refresh=0 -o auto_image=0 -dump %s; copiousoutput; \ description=HTML Text; nametemplate=%s.html