all repos — navani @ 6a3b4b68a2ff0917e49e2eeb42f8d6b99281fb1d

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}