Skip to content

Commit

Permalink
Don't HTML escape bazel mod JSON output
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 bazelbuild#22691

Closes bazelbuild#23785.

PiperOrigin-RevId: 680633877
Change-Id: Ic3c90c33bbf1209efa90be78b432e2132f0a1f05
  • Loading branch information
fmeum authored and copybara-github committed Sep 30, 2024
1 parent af38f3b commit e959d78
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 e959d78

Please sign in to comment.