// Package mailhtml renders untrusted email bodies safely.
//
// Two directions: Sanitize produces display-safe HTML for the dashboard (the
// message body arrives from the sender's mail client and is fully untrusted),
// and ToText flattens an HTML body into readable plain text for snippets and
// any other text-only consumer.
package mailhtml
import (
"html"
"regexp"
"strings"
"unicode/utf8"
"github.com/microcosm-cc/bluemonday"
)
// Elements whose text content must never survive stripping. A