mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Dev: Improve line break display
This commit is contained in:
@@ -1083,6 +1083,21 @@ Escapes a string for insertion into HTML, replacing &, <, >, ", `, and ' charact
|
||||
escape('You & Me'); -> // -> 'You & 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.
|
||||
|
||||
Reference in New Issue
Block a user