diff --git a/src/components/Connection.tsx b/src/components/Connection.tsx index f6a009e..ad58365 100644 --- a/src/components/Connection.tsx +++ b/src/components/Connection.tsx @@ -1,4 +1,3 @@ - import React from 'react'; interface ConnectionProps { @@ -9,12 +8,16 @@ interface ConnectionProps { } export const Connection: React.FC = ({ from, to, fromColor = '#a855f7', toColor = '#a855f7' }) => { - // Create gradient ID based on colors to ensure uniqueness - const gradientId = `gradient-${fromColor.replace('#', '')}-${toColor.replace('#', '')}`; + // Create a safe gradient ID by removing special characters + const gradientId = `gradient-${fromColor.replace(/[^a-zA-Z0-9]/g, '')}-${toColor.replace(/[^a-zA-Z0-9]/g, '')}`; return ( + + + +