mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-28 08:14:48 +08:00
fix: replace json before js fence (#344)
This commit is contained in:
@@ -7,8 +7,8 @@ export function parseJSON<T>(json: string | null | undefined, fallback: T) {
|
|||||||
try {
|
try {
|
||||||
const raw = json
|
const raw = json
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^```js\s*/, "")
|
|
||||||
.replace(/^```json\s*/, "")
|
.replace(/^```json\s*/, "")
|
||||||
|
.replace(/^```js\s*/, "")
|
||||||
.replace(/^```ts\s*/, "")
|
.replace(/^```ts\s*/, "")
|
||||||
.replace(/^```plaintext\s*/, "")
|
.replace(/^```plaintext\s*/, "")
|
||||||
.replace(/^```\s*/, "")
|
.replace(/^```\s*/, "")
|
||||||
|
|||||||
Reference in New Issue
Block a user