瀏覽代碼

fix: the display format of json

ShengYan, Zhang 1 年之前
父節點
當前提交
6bbdaf7ab0
共有 1 個文件被更改,包括 3 次插入0 次删除
  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");
 }