User:Polygnotus/Scripts/Surveys.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 19:
}
// Clean up the JSON string - remove any trailing commas before closing brackets
const surveyData = JSON.parse(jsonMatch[1]);
let jsonString = jsonMatch[1];
jsonString = jsonString.replace(/,(\s*[\]}])/g, '$1');
console.log('Raw JSON found:', jsonString.substring(0, 200) + '...');
const surveyData = JSON.parse(jsonMatch[1]jsonString);
console.log('Found survey data:', surveyData);