Dev: Improve line break display

This commit is contained in:
surunzi
2018-02-16 17:39:19 +08:00
parent eb923bab37
commit 8e79b97938
6 changed files with 167 additions and 46 deletions

View File

@@ -1083,6 +1083,21 @@ Escapes a string for insertion into HTML, replacing &, <, >, ", `, and ' charact
escape('You & Me'); -> // -> 'You &amp; Me'
```
## escapeJsStr
Escape string to be a valid JavaScript string literal between quotes.
http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4
|Name |Type |Desc |
|------|------|----------------|
|str |string|String to escape|
|return|string|Escaped string |
```javascript
escapeJsStr('\"\n'); // -> '\\"\\\\n'
```
## escapeJsonStr
Escape json string.