Skip to content

Commit

Permalink
add line breaks to generated JSON, for better diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Feb 19, 2024
1 parent a21e632 commit edb5d1f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CiteHighlighter/NPPSG to array tool/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,8 @@ class NPPSG {
}

prettyJSON(input) {
let output = JSON.stringify(input);

// after every comma, put an enter
output = output.replace(/\],/g, "],\n\n");

// the third parameter being '\t' results in output with line breaks, which is what I want
let output = JSON.stringify(input, null, '\t');
return output;
}

Expand Down

0 comments on commit edb5d1f

Please sign in to comment.