8000 Revert "Update examples in README to use indentation" · PatrickJS/serialize-javascript@9589229 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9589229

Browse files
committed
Revert "Update examples in README to use indentation"
This reverts commit 9765765.
1 parent 587bae6 commit 9589229

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

README.md

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

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

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-
}
47+
```js
48+
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil&qu 9E2B ot;:null,"fn":function echo(arg) { return arg; },"re":/([^\\s]+)/g}'
6449
```
6550

6651
### Automatic Escaping of HTML Characters
@@ -73,12 +58,10 @@ serialize({
7358
});
7459
```
7560

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:
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:
7762

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

8467
## License

0 commit comments

Comments
 (0)
0