Fix copy link feature

This commit is contained in:
gpt-engineer-app[bot] 2025-09-30 20:09:49 +00:00
parent 391210fa72
commit d2de5581b6
2 changed files with 11 additions and 2 deletions

View file

@ -243,6 +243,15 @@ const allInteractives: Interactive[] = [
path: '/themes/games/craps-game',
theme: 'Games',
dateAdded: '2025-01-05'
},
{
id: 'neighbor-sum-avoidance',
title: 'Neighbor Sum Avoidance',
description: 'Arrange numbers in a circle so that the sum of two neighbors is never divisible by 3, 5, or 7. An interactive graph theory puzzle!',
tags: ['graph-theory', 'puzzle', 'arrangement', 'divisibility', 'circle', 'mathematics'],
path: '/themes/discrete-math/graphs/neighbor-sum-avoidance',
theme: 'Discrete Math',
dateAdded: '2025-01-22'
}
];

View file

@ -30,8 +30,8 @@ export const sanitizeUrl = (url: string): string => {
try {
const urlObj = new URL(url);
// Remove any potentially harmful query parameters
const cleanUrl = `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}`;
// Keep the full URL including pathname, search, and hash for proper routing
const cleanUrl = `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}${urlObj.search}${urlObj.hash}`;
return cleanUrl;
} catch {
return window.location.href;