diff --git a/view/html.go b/view/html.go index 2192b70a36ba8c89ec2c92973db9d774ac16fd5f..37487482377f91d08d33b6c63bcb64f8e924593f 100644 --- a/view/html.go +++ b/view/html.go @@ -40,6 +40,9 @@ func ProcessBody(rawBody string) (string, error) { return "", fmt.Errorf("could not parse email body: %w", err) } + // Remove style and script tags to clean up the view + doc.Find("style, script").Remove() + // Add newlines after block elements for better spacing doc.Find("p, div, h1, h2, h3, h4, h5, h6").Each(func(i int, s *goquery.Selection) { s.After("\n\n")