Skip to content

Commit 99e6d90

Browse files
committed
handling some newline
1 parent 69b649d commit 99e6d90

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"url": "https://github.com/timheuer/jsondbg.git"
1414
},
1515
"icon": "resources/icon.png",
16-
"version": "0.1.2",
16+
"version": "0.1.3",
1717
"engines": {
1818
"vscode": "^1.97.0"
1919
},

src/jsonViewer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export function registerViewJsonCommand(context: vscode.ExtensionContext): void
4848
jsonValue = jsonValue.replace(/\\"/g, '"');
4949
}
5050

51+
// Clean up line endings - handle both \r\n and \n
52+
jsonValue = jsonValue.replace(/\\r\\n|\\n|\\r/g, ' ').trim();
53+
5154
try {
5255
// Try to parse the JSON string
5356
const jsonObj = JSON.parse(jsonValue);
@@ -255,7 +258,7 @@ function getWebviewContent(jsonObj: any): string {
255258
256259
// Create the property div that will hold everything
257260
const propertyDiv = document.createElement('div');
258-
propertyDiv.className = 'property';
261+
propertyDiv.className = 'property-root';
259262
260263
// Create the row that holds the toggle and brackets
261264
const rowDiv = document.createElement('div');

0 commit comments

Comments
 (0)