A tool for printing from notmuch
Jesse Rosenthal
jrosenthal at jhu.edu
Sat Jan 29 12:09:14 PST 2011
Hi Sebastian,
On Sat, 29 Jan 2011 20:58:53 +0100, Sebastian Spaeth <Sebastian at SSpaeth.de> wrote:
> I prefer to not have dependencies outside the std lib in python, but for
> xml/html parsing, there is really nothing appropriate, it seems.
I agree. And I'll admit I mainly chose BeautifulSoup out of
familiarity. But you really can't count on email html being well-formed
-- just vaguely renderable. And you certainly can't count on it being
xhtml. So the built-in parsers wouldn't be of much help. And, in fact,
if someone pastes a Word doc into Outlook, then the MS-specific tags and
styles will even choke libtidy.
So BS is the best I could find for this job (putting a title into the
header and a table into the top of the body or html that might or might
not even have a header or a body tag). And it's always available in
Debian/Arch/Fedora/ports/MacPorts.
The alternative, since we're trying leaving the email's html alone, is
to do our business with splits and regexes. But that seems like a bad
road to head down.
Best,
Jesse
More information about the notmuch
mailing list