diff --git a/JSONPretty.jsx b/JSONPretty.jsx index 54ab466..4ddd0ed 100644 --- a/JSONPretty.jsx +++ b/JSONPretty.jsx @@ -13,7 +13,7 @@ module.exports = createReactClass({ var booSpan = ''; var sps = ind || ''; if (key) { - sps = sps + '"' + keySpan + key.replace(/[": ]/g, '') + spanEnd + '": '; + sps = sps + '"' + keySpan + key.replace(/^"|":\s$/g, '')+ spanEnd + '": '; } if (val) { diff --git a/src/JSONPretty.1337.css b/src/JSONPretty.1337.css index e69de29..b71d87c 100644 --- a/src/JSONPretty.1337.css +++ b/src/JSONPretty.1337.css @@ -0,0 +1 @@ +.json-pretty{line-height:1.3;color:#f8f8f2;background:#1e1e1e;}.json-pretty .json-key{color:#ff5e5e}.json-pretty .json-value{color:#fdb082}.json-pretty .json-string{color:#e9fdac}.json-pretty .json-boolean{color:#69c} diff --git a/src/JSONPretty.js b/src/JSONPretty.js index 5e264d1..223a90a 100644 --- a/src/JSONPretty.js +++ b/src/JSONPretty.js @@ -21,7 +21,7 @@ module.exports = createReactClass({ var booSpan = ''; var sps = ind || ''; if (key) { - sps = sps + '"' + keySpan + key.replace(/^"|":\s$/g, '') + spanEnd + '": '; + sps = sps + '"' + keySpan + key.replace(/[": ]/g, '') + spanEnd + '": '; } if (val) {