We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d72edfb commit e521553Copy full SHA for e521553
charm/src/iframe/static.ts
@@ -168,7 +168,7 @@ ${JSON.stringify(libraries)}
168
window.grabJson = (gstr) => {
169
// Function to extract and parse JSON from a string
170
// This handles both raw JSON strings and code blocks with JSON
171
- const jsonRegex = /\`\`\`(?:json)?[\\s\\n]*([\\s\\S]*?)[\\s\\n]*\`\`\`|(\\{[\\s\\S]*?\\})/;
+ const jsonRegex = /\`\`\`(?:json)?\s*([\s\S]*?)\s*\`\`\`|({[\s\S]*})/;
172
const match = gstr.match(jsonRegex);
173
174
if (match) {
0 commit comments