feat(docs): Ensure multiline JS objects are rendered properly. (#13535)

This commit is contained in:
joshualitt
2025-11-21 09:59:34 -08:00
committed by GitHub
parent 99c5bf2e97
commit 0713c86dec
5 changed files with 259 additions and 8 deletions

View File

@@ -57,7 +57,7 @@ export function formatDefaultValue(
return '[]';
}
try {
return JSON.stringify(value);
return JSON.stringify(value, null, 2);
} catch {
return String(value);
}
@@ -65,7 +65,7 @@ export function formatDefaultValue(
if (typeof value === 'object') {
try {
const json = JSON.stringify(value);
const json = JSON.stringify(value, null, 2);
if (json === '{}') {
return '{}';
}