nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: State of the art for HTML-to-text rendering?


From: Bakul Shah
Subject: Re: State of the art for HTML-to-text rendering?
Date: Mon, 18 Nov 2024 11:46:16 -0800

There is https://github.com/JohannesKaufmann/html-to-markdown to convert
html to markdown. You can use glow (https://github.com/charmbracelet/glow),
for example, to render markdown as formatted text. html2markdown won't
fetch any other links during conversion. glow has -w option to control
where word wrap occurs and works well for text. The few tests I did worked
ok.

> On Nov 8, 2024, at 6:10 AM, Conrad Hughes via Discussion of nmh development, 
> and help for new users <nmh-workers@nongnu.org> wrote:
> 
> Hi all,
> 
> Wondering what folk use these days to render HTML emails in a terminal
> window?  I've an old recipe which I picked up from the list as follows:
> 
>  mhshow-show-text/html: env SOCKS_SERVER="127.0.0.1:1" socksify w3m -T 
> text/html -dump -o display_image=false -o display_link_number=true '%f' -cols 
> 80
> 
> The invocation of socksify is supposed to prevent w3m from following any
> content linked in the page (email-has-been-opened type spyware), but
> that's not causing me any trouble that I'm aware of: w3m is though,
> slightly.  It seems that lots of messages I receive these days arrive
> with a content preview which gets excluded by embedded CSS when rendered
> using my desktop browser, but not by w3m.  This has the effect that HTML
> messages often start with a short paragraph ending "...", followed
> immediately by (usually) almost exactly the same text again.
> 
> (the recipe is also annoying because w3m actually almost never renders
> to 80 columns for some reason)
> 
> Any better approaches you've come across?
> 
> Conrad
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]