8000 Tweak README · imsobear/serialize-javascript@86958be · GitHub
[go: up one dir, main page]

Skip to content

Commit 86958be

Browse files
committed
Tweak README
1 parent 1ce6eef commit 86958be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

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

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

4747
```js
4848
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"fn":function echo(arg) { return arg; },"re":/([^\\s]+)/g}'
4949
```
5050

5151
### Automatic Escaping of HTML Characters
5252

53-
A primary feature of this package is to serialize code to a string of literal JavaScript which can be embedded in an HTML document by adding it as the contents of the `<script>` element. In order to make this safe, HTML characters and JavaScript line terminators are escaped automatically.
53+
A primary feature of this package is to serialize code to a string of literal JavaScript which can be embedded in an HTML document by adding it as the contents of the `<script>` element. In order to make this safe, HTML characters and JavaScript line terminators are escaped automatically.
5454

5555
```js
5656
serialize({
5757
haxorXSS: '</script>'
5858
});
5959
```
6060

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:
61+
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:
6262

6363
```js
6464
'{"haxorXSS":"\\u003C\\u002Fscript\\u003E"}'

0 commit comments

Comments
 (0)
0