jtidy

Can I prevent JTidy from converting an apostrophe in an attribute value to an entity


My input HTML has a line similar to this:

<div class="image" style="background:url('/images/someImage.jpg') no-repeat;"/>

which JTidy is converting to

<div class="image" style="background:url(&apos;/images/someImage.jpg&apos;) no-repeat;"/>

Is there a way to suppress that entity conversion? There appears to be a config method for preventing double quotes from being converted (setQuoteMarks()), but I don't see similar for apostrophes.


Solution

  • Are you using the escapeXml() method?

    If so try the escapeHtml3() or escapeHtml4() method.