caldwell / renderjson

Render JSON into collapsible HTML
http://caldwell.github.io/renderjson
418 stars 91 forks source link

Added ablility to change `"` symbol arout the keys #43

Open Strongleong opened 2 years ago

Strongleong commented 2 years ago

I decide to implement #42 by myself. It was not hard :slightly_smiling_face: I added set_key_surronud_symbol function to API. It accepts string and wrappes keys around it:

renderjson.set_key_surround_symbol('"');
renderjson(data)

// Output:
// "key1": {
//   "key2": "a",
//   "key3": 5
// .......
// }

renderjson.set_key_surround_symbol("|");
renderjson(data)

// Output:
// |key1|: {
//   |key2|: "a",
//   |key3|: 5
// .......
// }