Fix copy link feature
This commit is contained in:
parent
391210fa72
commit
d2de5581b6
2 changed files with 11 additions and 2 deletions
|
|
@ -243,6 +243,15 @@ const allInteractives: Interactive[] = [
|
||||||
path: '/themes/games/craps-game',
|
path: '/themes/games/craps-game',
|
||||||
theme: 'Games',
|
theme: 'Games',
|
||||||
dateAdded: '2025-01-05'
|
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'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ export const sanitizeUrl = (url: string): string => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const urlObj = new URL(url);
|
const urlObj = new URL(url);
|
||||||
// Remove any potentially harmful query parameters
|
// Keep the full URL including pathname, search, and hash for proper routing
|
||||||
const cleanUrl = `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}`;
|
const cleanUrl = `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}${urlObj.search}${urlObj.hash}`;
|
||||||
return cleanUrl;
|
return cleanUrl;
|
||||||
} catch {
|
} catch {
|
||||||
return window.location.href;
|
return window.location.href;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue