mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 15:11:13 +08:00
Merge pull request #1782 from yanCode/fix/json-format
fix: the display format of json error
This commit is contained in:
@@ -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");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user