Table: Fix JSON formatting (#92715)

This commit is contained in:
Adela Almasan 2024-08-30 08:51:51 -06:00 committed by GitHub
parent 962fcf1fa8
commit 91cbaa4afe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,10 +28,11 @@ export function TableCellInspector({ value, onDismiss, mode }: TableCellInspecto
if (trimmedValue[0] === '{' || trimmedValue[0] === '[' || mode === 'code') { if (trimmedValue[0] === '{' || trimmedValue[0] === '[' || mode === 'code') {
try { try {
value = JSON.parse(value); value = JSON.parse(value);
displayValue = JSON.stringify(value, null, '');
} catch {} } catch {}
} }
} else { } else {
displayValue = JSON.stringify(value, null, ' '); displayValue = JSON.stringify(value, null, '');
} }
let text = displayValue; let text = displayValue;