mganss / HtmlSanitizer

Cleans HTML to avoid XSS attacks
MIT License
1.55k stars 200 forks source link

How do we handle emails in angle brackets #179

Closed CodePala closed 5 years ago

CodePala commented 5 years ago

Team,

When we are using htmlsanitizer in an example like below, everything after left angle bracket is being removed. But we need to keep the emails in the text. How do we handle these scenarios?

Example : testuser <testuser@xyz.com> custom notes to user

When we use sanitizer, everything is being cleaned up in the above example except first word "testuser".

mganss commented 5 years ago

Duplicate of #126. See https://github.com/mganss/HtmlSanitizer/wiki/Examples#ex4-encode-non-html-before-sanitizing for a solution.