From 6bbdaf7ab0499dbb8554173b175caf440f2b424d Mon Sep 17 00:00:00 2001 From: "ShengYan, Zhang" Date: Wed, 31 May 2023 19:39:39 +0800 Subject: [PATCH] fix: the display format of json --- app/utils/format.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/utils/format.ts b/app/utils/format.ts index 6c205c360e1..450d66696d9 100644 --- a/app/utils/format.ts +++ b/app/utils/format.ts @@ -6,5 +6,8 @@ export function prettyObject(msg: any) { if (msg === "{}") { return obj.toString(); } + if (msg.startsWith("```json")) { + return msg; + } return ["```json", msg, "```"].join("\n"); }