Parcourir la source

fix: the display format of json

ShengYan, Zhang il y a 1 an
Parent
commit
6bbdaf7ab0
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      app/utils/format.ts

+ 3 - 0
app/utils/format.ts

@@ -6,5 +6,8 @@ export function prettyObject(msg: any) {
   if (msg === "{}") {
   if (msg === "{}") {
     return obj.toString();
     return obj.toString();
   }
   }
+  if (msg.startsWith("```json")) {
+    return msg;
+  }
   return ["```json", msg, "```"].join("\n");
   return ["```json", msg, "```"].join("\n");
 }
 }