gjtorikian / html-pipeline

HTML processing filters and utilities
MIT License
2.27k stars 383 forks source link

Optionally filter email addresses #247

Closed oreoshake closed 8 years ago

oreoshake commented 8 years ago

It is common for email replies with quoted content to include email addresses in banners from quoted text. These email addresses may have been marked as private and by commenting via email, their email address is exposed. e.g.

Before

This is the content of a reply immediately following a comment by me.

> On Thu, Aug 13, 2015, 6:18 PM Boaty McBoatface boaty@example.com wrote:
> 
> A previous comment of mine

>> On Thu, Aug 13, 2015, 2:30 PM Steve notifications@example.com wrote:
>>
>> An even older comment

After

This adds a flag to the EmailReplyFilter that will gsub out things that look somewhat like email addresses (erring on the false positive side).

Before

This is the content of a reply immediately following a comment by me.

> On Thu, Aug 13, 2015, 6:18 PM Boaty McBoatface ***@***.*** wrote:
> 
> A previous comment of mine

>> On Thu, Aug 13, 2015, 2:30 PM Steve  ***@***.*** wrote:
>>
>> An even older comment

/cc @jch sorry I guess I forgot to hit submit before heading out for the weekend, tab was still open :smile:

jch commented 8 years ago

Thanks for making this backwards compatible.