Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I occasionally receive html messages and I would like to see whether text has been formatted or colored by the sender. I can simply navigate to the attachment list and open the text/html MIME type attachment with a web browser; however, for the sake of simplicity, I would prefer for the html to be rendered as formatted text within the pager. To do this, I have enabled html rendering by w3m with the following line in my .muttrc file:

auto_view text/html.

Additionally, I have added to my config file lines such as the following to highlight text that the sender may have designated as important:

color bold brightred default.

I expect that any text that was formatted as bold by the sender will appear as brightred in the pager. However, this formatting is not actually applied. Instead, I see only plaintext preceded by the statement:

[-- Autoview using /usr/bin/w3m -I 'ISO-8859-1' -dump -T text/html ''/tmp/mutt.html'' --].

What am I doing wrong? How do I enable display of html-formatted messages within pager?

share|improve this question
2  
The in-mutt color settings are for the built-in pager only - mutt has no control over w3m colors. You'll have to find a way to configure w3m to display colors the way you want in addition to mutt. –  jw013 Jul 31 '12 at 2:30
    
@jw013: Even if I remove the w3m invocation (auto_view text/html), the bold text from an html email is not formatted brightred (as per my example). Instead, the bold text is flanked by asterisks. What do I need to do to enable coloring for the built-in pager. Thanks. –  user001 Jul 31 '12 at 3:15
1  
AFAIK, Mutt doesn't have the ability to render HTML. I'm not sure where the asterisks you are seeing come from, but I don't think it's related to the color setting of the built-in pager. –  jw013 Jul 31 '12 at 3:19
    
@jw013: I suppose I misunderstood the color object foreground background syntax from §3.9 of the mutt documentation. I interpreted bold objects/patterns as being html-defined, but I now suppose these are defined as bold in some other manner (how?). Many thanks. –  user001 Jul 31 '12 at 3:34
1  
Just did some testing: bold works with the (letter, ^H, letter) sequence described in section 5.2. –  jw013 Jul 31 '12 at 22:11
show 3 more comments

1 Answer

Mutt does not parse HTML. If you turn off HTML viewing, you won't see HTML content. Many mailers generate MIME multipart messages, with the same text present twice: once as an HTML part (text/html), and once as a text part (text/plain). The text part is mostly or completely devoid of formatting; some mail programs generate ASCII representations of emphasis *like* *this*.

The bold color setting is used by Mutt's built-in parser for text/enriched. Few programs send text/enriched content, so you're probably seeing a plain text part, with no formatting.

If you turn on automatic HTML viewing, then mutt isn't doing the displaying. W3m handles the formatting, and it always displays bold as bold.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.