all repos — navani @ 4c31ab587f36ba632ad0a08393ecd92227d19e0e

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}