1. John Lenz
  2. notmuch-web
Issue #5 resolved

Viewing flowed messages

John Lenz
repo owner created an issue

Right now, we display the message text content in a HTML pre which does not do any wrapping, which makes it painful to read on my phone. Most messages nowadays are sent using some type of reflow:

  • html alternative: the email comes with a MIME alternative to type text/html. We should detect and automatically prefer this alternative to the text one. Of course, we need to filter which HTML tags get passed through and for that we can use xss-santiize (http://hackage.haskell.org/package/xss-sanitize). I think at the start we should restrict even more than xss-santize does, perhaps only div and p (which is all flow should need)

  • format=flowed: actually a grep of my email showed not that many flowed messages. Here we have a slight problem: the format=flowed header does not appear in the notmuch JSON response. We can parse the format=flowed messages ourselves pretty easy and generate HTML p tags, but we need to know the message is flowed. Perhaps we can for now just try parsing every message as flowed and work on getting notmuch to at least return the header in the JSON, although notmuch could also parse it into paragraphs and return them.

Comments (1)

  1. John Lenz reporter

    With the latest release, flowed messages on small screens are displayed properly. Still format=flowed messages are not parsed properly since notmuch does not tell us the message is format=flowed, but the message is still markdown and so the markdown parser will make it flowed.

  2. Log in to comment