Skip to content

Commit

Permalink
fix: fix issue 9
Browse files Browse the repository at this point in the history
  • Loading branch information
colin.ck committed Apr 4, 2018
1 parent 5fa7e8c commit 3df6945
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ Since the version 1.3.0, we have added more color themes to this package, includ

## Changelog

### 1.7.6

1. Fix [issue 9](https://github.com/chenckang/react-json-pretty/issues/9)

### 1.7.0

1. Add JSON formation properties —— `replacer` `space`
Expand Down
5 changes: 3 additions & 2 deletions example/app/Example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ var CircularJSON = require('circular-json')
var obj = require('../package.json');
var obj2 = {
aaaa: 1,
bbbb: true,
'bb:bb': true,
cccc: "ab\"cd\\",
':i\"iii:': ":ii:ii",
dddd: {
eeee: 1,
ffff: [
{
gggg: 3
},
2,
"string"
"str:ing"
]
}
};
Expand Down
1 change: 0 additions & 1 deletion src/JSONPretty.1337.css
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
.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}
2 changes: 1 addition & 1 deletion src/JSONPretty.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = createReactClass({
var booSpan = '<span class=json-boolean>';
var sps = ind || '';
if (key) {
sps = sps + '"' + keySpan + key.replace(/[": ]/g, '') + spanEnd + '": ';
sps = sps + '"' + keySpan + key.replace(/^"|":\s$/g, '') + spanEnd + '": ';
}

if (val) {
Expand Down

0 comments on commit 3df6945

Please sign in to comment.