all repos — navani @ ba43e00509525ff19367de917574a8270a4a836c

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}