From 91e68e854725d35f09a09b4a60b525e81d8186f6 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 20 Aug 2018 15:20:18 +1200 Subject: [PATCH] put html dumping into a wrapper script --- .gitignore.d/mutt | 1 + .mutt/htmldump | 5 +++++ .mutt/mailcap.htmldump | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 .mutt/htmldump diff --git a/.gitignore.d/mutt b/.gitignore.d/mutt index bfea42a..757457b 100644 --- a/.gitignore.d/mutt +++ b/.gitignore.d/mutt @@ -15,6 +15,7 @@ !/.mutt/.gitignore !/.mutt/headers !/.mutt/hooks +!/.mutt/htmldump !/.mutt/icalparser !/.mutt/keybindings !/.mutt/list-mailboxes diff --git a/.mutt/htmldump b/.mutt/htmldump new file mode 100755 index 0000000..d8d9ff7 --- /dev/null +++ b/.mutt/htmldump @@ -0,0 +1,5 @@ +#!/bin/sh + +exec elinks -anonymous -localhost -eval "set document.codepage.assume = '$2'" \ + -force-html -dump -dump-charset utf-8 -dump-color-mode 0 | + sed -re 's,^[[:space:]]{3},,' diff --git a/.mutt/mailcap.htmldump b/.mutt/mailcap.htmldump index 217e858..6a3743d 100644 --- a/.mutt/mailcap.htmldump +++ b/.mutt/mailcap.htmldump @@ -2,4 +2,4 @@ # Mutt mailcap for dumping HTML to text # -text/html; elinks -anonymous -localhost -eval "set document.codepage.assume = %{charset}" -force-html -dump -dump-charset utf-8 -dump-color-mode 4; description=HTML Text; nametemplate=%s.html; copiousoutput +text/html; ~/.mutt/htmldump --from %{charset}; description=HTML Text; nametemplate=%s.html; copiousoutput -- 2.39.5