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

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

  •  29-11-2021
  •  | 
  •  

Pregunta

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.

¿Fue útil?

Solución

Are you using the escapeXml() method?

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top