Skip to content

Commit f77866f

Browse files
authored
Merge pull request #175 from ChaseWagoner/spaces-removed
Preserve spaces in plain strings
2 parents e23fbc8 + 54a0de5 commit f77866f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extension/src/json-viewer/jsl-format.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ jsl.format = (function () {
111111
}
112112
break;
113113
case '"':
114-
if (i > 0 && (json.charAt(i - 1) !== '\\' || (json.charAt(i - 1) == '\\' && json.charAt(i - 2) == '\\'))) {
114+
if (i === 0) {
115+
inString = true;
116+
}
117+
else if (json.charAt(i - 1) !== '\\' || (json.charAt(i - 1) == '\\' && json.charAt(i - 2) == '\\')) {
115118
inString = !inString;
116119
}
117120
newJson += currentChar;

0 commit comments

Comments
 (0)