all repos — navani @ 30df9bfd236b6663e10ef9feaf0a38355e7b896b

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}