fix: replace json before js fence (#344)

This commit is contained in:
johnny0120 2025-06-26 08:40:32 +08:00 committed by GitHub
parent 82e1b65792
commit aa06cd6fb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,8 +7,8 @@ export function parseJSON<T>(json: string | null | undefined, fallback: T) {
try {
const raw = json
.trim()
.replace(/^```js\s*/, "")
.replace(/^```json\s*/, "")
.replace(/^```js\s*/, "")
.replace(/^```ts\s*/, "")
.replace(/^```plaintext\s*/, "")
.replace(/^```\s*/, "")