From 743cec0bc19c80704ef04a601c308522de594c56 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 27 Sep 2024 11:17:27 +0200 Subject: [PATCH] Don't HTML escape `bazel mod` JSON output Otherwise `""` ends up being escaped with Unicode escape sequences, which is unnecessarily complex. --- .../build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java index c0111184b93035..ab8e9da6391c18 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java @@ -44,7 +44,8 @@ public void output() { seenExtensions = new HashSet<>(); JsonObject root = printModule(ModuleKey.ROOT, null, IsExpanded.TRUE, IsIndirect.FALSE); root.addProperty("root", true); - printer.println(new GsonBuilder().setPrettyPrinting().create().toJson(root)); + printer.println( + new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create().toJson(root)); } public String printKey(ModuleKey key) {