Parser JSoup change the tags to lower case letter

前端 未结 5 1047
灰色年华
灰色年华 2020-12-20 15:39

I did some research and it seems that is standard Jsoup make this change. I wonder if there is a way to configure this or is there some other Parser I can be converted to a

5条回答
  •  长情又很酷
    2020-12-20 15:49

    I am using 1.11.1-SNAPSHOT version which does not have this piece of code.

    private Tag(String tagName) {
        this.tagName = tagName.toLowerCase();
    }
    

    So I checked ParseSettings as suggested above and changed this piece of code from:

    static {
        htmlDefault = new ParseSettings(false, false);
        preserveCase = new ParseSettings(true, true);
    }
    

    to:

    static {
        htmlDefault = new ParseSettings(true, true);
        preserveCase = new ParseSettings(true, true);
    }
    

    and skipped test cases while building JAR.

提交回复
热议问题