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.08k stars 178 forks source link

Filter multiple class values through whitelist #205

Open Liuxc95 opened 4 months ago

Liuxc95 commented 4 months ago

When I was dealing with the class attribute, I found that multiple class values could not be filtered through the whitelist. For example, <p class="class1 class2 class3"><p>, the whitelist is [class1, class3] and I hope to get<p class="class1 class3"><p>after filtering. How can I achieve this?