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

@@ -1,9 +1,9 @@
/* Escape json string.
*/
_('escapeJsStr');
function exports(str)
{
return str.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\f|\n|\r|\t/g, '');
return escapeJsStr(str).replace(/\\'/g, '\'');
}