Hi,

On Monday Jul 07 2014, Jeff Kowalczyk wrote:

> Using mu from git master @ ab5830 (0.9.9.6), I would like to filter out 
> unwanted
> characters from mu's rendering of HTML email. Without resorting to running 
> an
> external html to text process for each message view buffer [1] [2], is 
> there a
> way for mu a) be more aggressive with its own filter, and b) filter and/or 
> map
> unwanted characters to an accepted set for display?
>
> Many but not all HTML-format emails from correspondents carry these visual
> artifacts. The most common occurrence is in their citation (reply, forward)
> header block, and footer blocks. An example, presuming email preserves 
> hat-H and
> other characters:
>
> ---
>
> F^HFr^Hro^Hom^Hm:^H: First Last
> S^HSe^Hen^Hnt^Ht:^H: Thursday, July 03, 2014 7:46 AM
> T^HTo^Ho:^H: First Last
> C^HCc^Hc:^H: First Last
> S^HSu^Hub^Hbj^Hje^Hec^Hct^Ht:^H: The subject

Hmmm, that looks pretty bad! The default html2text is not very good for
non-trivial html...

It's possible to use `shr' for rendering instead, which gives pretty
good results; Titus von der Malsburg posted a snippet on this list:

--8<---------------cut here---------------end--------------->8---
  (defun html2text ()
    "Replacement for standard html2text using shr."
    (interactive)
    (let ((dom (libxml-parse-html-region (point-min) (point-max))))
       (erase-buffer)
       (shr-insert-document dom)
       (goto-char (point-min))))
--8<---------------cut here---------------end--------------->8---

If you want to use the normal html2text, you could 'advise' it and do
some filtering there.

Cheers,
Dirk.

-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:[email protected]           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

-- 
You received this message because you are subscribed to the Google Groups 
"mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to