Clean Email
Strip formatting from pasted email for clean plain text
Clean DataHow it works
1. html-to-text Convert HTML to plain text preserving line breaks 2. strip-invisible Strip invisible Unicode (watermarks, fingerprints) 3. normalize-quotes Normalize smart quotes, dashes, and ellipsis to ASCII 4. trim-lines Trim whitespace from each line 5. squeeze Collapse extra whitespace and blank lines
$ html-to-text | strip-invisible | normalize-quotes | trim-lines | squeeze Examples
Clean a shipping confirmation email for plain-text archiving
Usage
"<div style="font-family:Arial"><p>Hi John,</p><p>Your order ..." | html-to-text | strip-invisible | normalize-quotes | trim-lines | squeeze Strip table formatting from a meeting agenda email
Usage
"<table><tr><td style="padding:10px"><b>Meeting Agenda</b></t..." | html-to-text | strip-invisible | normalize-quotes | trim-lines | squeeze Convert a formatted job offer email to clean text for notes
Usage
"<p style="color:#333">Dear Applicant,</p><p>We’re pleased to..." | html-to-text | strip-invisible | normalize-quotes | trim-lines | squeeze