microcosm-cc / bluemonday

bluemonday: a fast golang HTML sanitizer (inspired by the OWASP Java HTML Sanitizer) to scrub user generated content of XSS
https://github.com/microcosm-cc/bluemonday
BSD 3-Clause "New" or "Revised" License
3.12k stars 176 forks source link

Can I use bluemonday to remove certain links? #149

Closed akfaew closed 1 year ago

akfaew commented 1 year ago

I wish to remove links that have "unsubscribe" somewhere in the anchor or in the url. Is that possible?

buro9 commented 1 year ago

bluemonday doesn't support that... but you could use https://pkg.go.dev/golang.org/x/net/html directly to do this.