// Debug script to test what the server actually receives const diagram = `graph TD A[Test] --> B[Node] A --> C[Another]`; console.log("Original diagram:"); console.log(JSON.stringify(diagram)); console.log("\nDiagram visualization:"); console.log(diagram); // Test with both your current format and a simple test const testCases = [ { name: "Simple test", diagram: "graph TD\n A --> B" }, { name: "Your format", diagram: diagram }, { name: "Minimal", diagram: "graph TD\nA-->B" } ]; testCases.forEach((testCase, i) => { console.log(`\n=== Test Case ${i+1}: ${testCase.name} ===`); console.log("JSON representation:", JSON.stringify(testCase.diagram)); console.log("Actual content:"); console.log(testCase.diagram); console.log("Length:", testCase.diagram.length); console.log("Contains newlines:", testCase.diagram.includes('\n')); console.log("Newline positions:", [...testCase.diagram].map((char, idx) => char === '\n' ? idx : null).filter(x => x !== null)); });