Proper usage of JTidy to purify HTML

前端 未结 3 1395
梦毁少年i
梦毁少年i 2021-01-13 03:18

I am trying to use JTidy (jtidy-r938.jar) to sanitize an input HTML string, but I seem to have problems getting the default settings right. Often strings such as \"hello wor

3条回答
  •  野的像风
    2021-01-13 04:04

    Have a look at how JTidy is configured:

    StringWriter writer = new StringWriter();
    tidy.getConfiguration().printConfigOptions(writer, true);
    System.out.println(writer.toString());
    

    Maybe it then get clear what causes the problem.

    What is weird? Little example, of actual output and expected... maybe ?

提交回复
热议问题