Skip to content

Commit

Permalink
Forgot to escape JSON string output (#4280)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
  • Loading branch information
geeknoid and Martin Taillefer authored Aug 12, 2023
1 parent 7c322ad commit ee5bc2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Generators/Microsoft.Gen.ComplianceReports/Emitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ private void OutArray(string name, Action action)

private void OutNameValue(string name, string value)
{
value = value
.Replace("\\", "\\\\")
.Replace("\"", "\\\"");

NewItem();
OutIndent();
Out($"\"{name}\": \"{value}\"");
Expand Down

0 comments on commit ee5bc2a

Please sign in to comment.