I\'m using Jsoup for sanitizing user input from a form. The form in question contains a that expects plain text. When the form is submitted, I
If your textarea just expects plain text, then I think you'd be better off just HTML escaping the plain text. I.e. convert user's input <
and >
tags to <
and >
respectively. Either on input our output (input might be safer so you only need to think about it once).
The jsoup HTML cleaner is, as you say, designed to parse untrusted input HTML and outuput trusted HTML, where formatting is done with elements.