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

StackOverflow https://stackoverflow.com/questions/13369414

  •  29-11-2021
  •  | 
  •  

Question

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.

Était-ce utile?

La solution

Are you using the escapeXml() method?

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top