java-html-sanitizer
java-html-sanitizer copied to clipboard
Issue when using < as a the comparaison string
Hi,
Is there a way to sanitize something like If b is 0 and a is 1 then b<a ? the sanitizer recognize <a as an html tag, and it looks like it's adding the closing tag and then it's going through the sanitizer, so something like
String entryText = "If b is 0 and a is 1 then b<a";
Policy policy = new HtmlPolicyBuilder().toFactory();
String result = policy.sanitize(entryText);
will return If b is 0 and a is 1 then b
I'm expecting If b is 0 and a is 1 then b<a
(note that if the entry text is If b is 0 and a is 1 then b< a then the result is as expected If b is 0 and a is 1 then b< a)
If you have plain text, you might need not to sanitize (valid) HTML but to escape HTML special characters.
Duplicate of issue #173?