package mailhtml import ( "sort" "strings" "github.com/andybalholm/cascadia" "golang.org/x/net/html" "golang.org/x/net/html/atom" ) // maxInlineBytes bounds the work the inliner will take on. A body past this is // already unsendable (Gmail clips at ~102 KB), so it ships as written rather // than paying for a parse nobody benefits from. const maxInlineBytes = 2 << 20 // Elements a declaration can never usefully land on. var noInlineTarget = map[string]bool{ "html": true, "head": true, "meta": true, "title": true, "link": true, "base": true, "script": true, "style": true, } // Pseudo-classes and pseudo-elements whose match depends on reader state, so // their rule has to stay in the