javahtmlowaspantisamy

Antisamy converting single quotes to double quotes


When i am trying to scan a html tag through antisammy, It gives weird output. It converts single quotes to double quotes.

CleanResults cr = as.scan(dirtyContent, policy);
System.out.println(cr.getCleanHTML());

Input string - <span style="font-family: 'times new roman', times, serif;">My name is Gourav</span>

Output string - <span style="font-family: &quot;times new roman&quot; , times , serif;">My name is Gourav</span>

So, as you can see, the single quotes are encoded as &quot; which when decoded gives " instead of '. This is causing problems for me.

Antisammy Version - 1.5.3

Policy File - antisamy-anythinggoes.xml

How can i solve this? Any help is appreciated


Solution

  • I raised this issue in the Antisammy GitHub project. This issue is now fixed :) . Please check the release notes for Release 1.7.1.