Ver Fonte

fix: the display format of json

ShengYan, Zhang há 1 ano atrás
pai
commit
6bbdaf7ab0
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      app/utils/format.ts

+ 3 - 0
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");
 }