javaowaspantisamy

OWASP AntiSamy are replacing line breaks to espaces (JAVA)


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?


Solution

  • I already fix the issue inserting the line

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

    in configuration file