Skip to content

Commit

Permalink
[7.4.0] Don't HTML escape bazel mod JSON output (#23819)
Browse files Browse the repository at this point in the history
Otherwise `"<root>"` ends up being escaped with Unicode escape
sequences, which is unnecessarily complex.

Work towards #22691

Closes #23785.

PiperOrigin-RevId: 680633877
Change-Id: Ic3c90c33bbf1209efa90be78b432e2132f0a1f05

Commit
e959d78

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
bazel-io and fmeum authored Oct 1, 2024
1 parent 61f49cc commit 073affa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 073affa

Please sign in to comment.