jtidy icon indicating copy to clipboard operation
jtidy copied to clipboard

Escaping of "<" characters into "&lt;"

Open cluick opened this issue 4 years ago • 0 comments

Dear all, this is more a question than an issue... I have an application where users can enter HTML source code for formatting. Somtimes it happens that users enter a less-than character ("<") instead of the entity "&lt;" which leads to a damaged DOM and hidden content in some browsers. Is there a way to deal with such characters in JTidy? Currently I´m using JTidy with the following settings:

Tidy tidy = new Tidy();
tidy.setPrintBodyOnly(true);
tidy.setRawOut(true);
tidy.setWraplen(0);
tidy.setOutputEncoding("UTF-8");
tidy.setQuiet(true);

Thank you and best regards, Christof

cluick avatar May 04 '20 11:05 cluick