diff --git a/src/components/AIRoadmap/AIRoadmapChat.tsx b/src/components/AIRoadmap/AIRoadmapChat.tsx index 9de8aeea2b7e..bcec4fccc771 100644 --- a/src/components/AIRoadmap/AIRoadmapChat.tsx +++ b/src/components/AIRoadmap/AIRoadmapChat.tsx @@ -178,7 +178,8 @@ export function AIRoadmapChat(props: AIRoadmapChatProps) { useImperativeHandle(aiChatActionsRef, () => ({ handleNodeClick: (node: RoadmapNodeDetails) => { - handleSubmitInput(`Explain what is "${node.nodeTitle}" topic in detail.`); + const safeTitle = node.nodeTitle.replace(/["\\\n\r]/g, '').trim(); + handleSubmitInput(`Explain what is "${safeTitle}" topic in detail.`); }, }));