문제

Is there anything in JavaSE, Spring or Apache Commons StringUtils that would allow me to strip out HTML from a String but also supply a whitelist of HTML entities that I would like to allow?

Thanks

도움이 되었습니까?

해결책 2

Using a regular expression was the answer here. There was no solution to this issue in any of the libraries available to me.

다른 팁

You can take a look at OWASP AntiSamy project. It has default policy files, but you can tailor them to your needs; see the Developer Guide for details on that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top