all repos — navani @ 7251f1ba6f5f2ef42c543124d0132057f4894ee4

forlater's primary mail processing service

reader/plain.go (view raw)

 1package reader
 2
 3import (
 4	"os/exec"
 5	"strings"
 6)
 7
 8func MakePlaintext(html []byte) ([]byte, error) {
 9	args := []string{"-image_links", "-dump", "-stdin"}
10	cmd := exec.Command("lynx", args...)
11	cmd.Stdin = strings.NewReader(string(html))
12	out, err := cmd.Output()
13	if err != nil {
14		return nil, err
15	}
16	return out, nil
17}