Skip to content

Commit 9765765

Browse files
committed
Update examples in README to use indentation
1 parent 826a981 commit 9765765

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,25 @@ serialize({
4242
});
4343
```
4444

45-
The above will produce the following output:
45+
The above will produce the following string output:
4646

47-
```js
48-
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"fn":function echo(arg) { return arg; },"re":/([^\\s]+)/g}'
47+
```
48+
{
49+
"str": "string",
50+
"num": 0,
51+
"obj": {
52+
"foo": "foo"
53+
},
54+
"arr": [
55+
1,
56+
2,
57+
3
58+
],
59+
"bool": true,
60+
"nil": null,
61+
"fn": function echo(arg) { return arg; },
62+
"re": /([^\s]+)/g
63+
}
4964
```
5065

5166
### Automatic Escaping of HTML Characters
@@ -58,10 +73,12 @@ serialize({
5873
});
5974
```
6075

61-
The above will produce the following, HTML-escaped output which is safe to put into an HTML document as it will not cause the inline script element to terminate:
76+
The above will produce the following string, HTML-escaped output which is safe to put into an HTML document as it will not cause the inline script element to terminate:
6277

63-
```js
64-
'{"haxorXSS":"\\u003C\\u002Fscript\\u003E"}'
78+
```
79+
{
80+
"haxorXSS": "\u003C\u002Fscript\u003E"
81+
}
6582
```
6683

6784
## License

0 commit comments

Comments
 (0)