[AGE-3349] [Bug] JSON handling issue in the evaluator playground
Describe the bug
There is an issue in the evaluator Playground in the editor which makes it so that if you provide a string that has a JSON Markdown, it handles it as if it was without.
But there is still a problem with the edit mode. I do not know how, but it counts this: "
json"\n{\n \"direction\": \"bullish\",\n }\n"" As this: "\n{\n "direction": "bullish",\n }\n" And it shouldn't. It does not happen in the evaluation when the evaluator runs. just in the edit tab.
The edit mode in the evaluator Playground uses the SharedEditor component, which extracts only the plain text content from the editor input—this means any JSON Markdown formatting (like code block syntax or language tags) is stripped and treated as raw JSON text. This differs from the evaluation mode, which appears to handle JSON Markdown correctly. The root cause is that the edit mode's change handler uses value.textContent, so it doesn't distinguish between JSON Markdown and plain JSON, leading to the issue you described. You can see how the editor is configured and how input is processed in the code for SharedEditor and its configuration logic (SharedEditor, useEditorConfig).
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
A bit more context: under traces I can see the output is ׳׳׳json"\n{\n "direction": "bullish",\n }\n׳׳׳" But json.loads(output) works, but it should not work