mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-10 17:22:00 -04:00
remove trailing whitespace
This commit is contained in:
parent
e1edc8079f
commit
0b6709392b
104 changed files with 1479 additions and 1479 deletions
|
@ -7,18 +7,18 @@
|
|||
if (typeof global.JSON == "undefined" || !global.JSON) {
|
||||
global.JSON = {};
|
||||
}
|
||||
|
||||
|
||||
global.JSON.minify = function(json) {
|
||||
|
||||
|
||||
var tokenizer = /"|(\/\*)|(\*\/)|(\/\/)|\n|\r/g,
|
||||
in_string = false,
|
||||
in_multiline_comment = false,
|
||||
in_singleline_comment = false,
|
||||
tmp, tmp2, new_str = [], ns = 0, from = 0, lc, rc
|
||||
;
|
||||
|
||||
|
||||
tokenizer.lastIndex = 0;
|
||||
|
||||
|
||||
while (tmp = tokenizer.exec(json)) {
|
||||
lc = RegExp.leftContext;
|
||||
rc = RegExp.rightContext;
|
||||
|
@ -30,7 +30,7 @@
|
|||
new_str[ns++] = tmp2;
|
||||
}
|
||||
from = tokenizer.lastIndex;
|
||||
|
||||
|
||||
if (tmp[0] == "\"" && !in_multiline_comment && !in_singleline_comment) {
|
||||
tmp2 = lc.match(/(\\)*$/);
|
||||
if (!in_string || !tmp2 || (tmp2[0].length % 2) == 0) { // start of string with ", or unescaped " character found to end string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue