Open SasiprabuK opened 1 year ago
I think not showing this is the right behavior try load it on a browser and it will not show it. Maybe what you need to do for text is using <
instead of <.
If you have plain text, you might need not to sanitize HTML but to escape HTML special characters.
cf. issue #240
Given inputs cleared, after apply sanitize for "<" with text inputs
Dependency - owasp-java-html-sanitizer version - 20200713.1
String inputText = "Sanitize <Data Check"; Policy policy = new HtmlPolicyBuilder().toFactory(); String result = policy.sanitize(inputText);
output: Actual: Sanitize <Data Check ==> (After sanitize) ==> Sanitize <Data Check - after the < symbol with further text inputs cleared completely. Expected: "Sanitize <Data Check" I have checked with latest version too. but, still same issue occurred. Please guide me, to solve this scenario.