OWASP AntiSamy are replacing line breaks to espaces (JAVA)

861 Views Asked by At

I'm using OWASP AntiSamy in a JAVA project but everytime I try call the method getCleanHTML() with a string that contains \n character, the method are replacing for a espace " ". I'm already tried to change the rules in XML file, but it still happening. How do I fix it?

1

There are 1 best solutions below

2
gFontaniva On BEST ANSWER

I already fix the issue inserting the line

<directive name="preserveSpace" value="true" />

in configuration file