Skip to content

Commit

Permalink
disableHtmlEscaping
Browse files Browse the repository at this point in the history
  • Loading branch information
iamlinhui committed Dec 15, 2020
1 parent 2d66adf commit 8b7a0d4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/hi/chyl/json/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,7 @@ private void formatJson() {
text = JSON.toJSONString(obj, SerializerFeature.WriteMapNullValue);
jsonEle = JsonParser.parseString(text);
if (jsonEle != null && !jsonEle.isJsonNull()) {
GsonBuilder gb = new GsonBuilder();
gb.setPrettyPrinting();
gb.serializeNulls();
Gson gson = gb.create();
Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().serializeNulls().create();
String jsonStr = gson.toJson(jsonEle);
if (jsonStr != null) {
// jsonStr = StringEscapeUtils.unescapeJava(jsonStr);
Expand Down Expand Up @@ -710,10 +707,7 @@ private void sortFormatJson() {
text = JSON.toJSONString(obj, SerializerFeature.WriteMapNullValue, SerializerFeature.MapSortField);
jsonEle = JsonParser.parseString(text);
if (jsonEle != null && !jsonEle.isJsonNull()) {
GsonBuilder gb = new GsonBuilder();
gb.setPrettyPrinting();
gb.serializeNulls();
Gson gson = gb.create();
Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().serializeNulls().create();
String jsonStr = gson.toJson(jsonEle);
if (jsonStr != null) {
// jsonStr = StringEscapeUtils.unescapeJava(jsonStr);
Expand Down

0 comments on commit 8b7a0d4

Please sign in to comment.