mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-06 20:55:18 +02:00
Updates
This commit is contained in:
30
index.html
30
index.html
@@ -54,25 +54,29 @@
|
||||
<script type="text/javascript">
|
||||
(function(l) {
|
||||
if (l.search && l.search.startsWith('/')) {
|
||||
// Extract and clean up the query string
|
||||
const decoded = l.search
|
||||
.slice(1) // Remove the leading "/"
|
||||
.split('&') // Split the query string by "&"
|
||||
.filter(Boolean) // Remove empty strings caused by consecutive "&"
|
||||
.map(s => s.replace(/~and~/g, '&')) // Replace "~and~" with "&"
|
||||
.join('&'); // Join back with "&"
|
||||
// Extract the search string and remove the leading slash
|
||||
const originalQuery = l.search.slice(1);
|
||||
|
||||
// Reconstruct the URL and replace the history entry
|
||||
window.history.replaceState(
|
||||
null,
|
||||
'', // Keep the title unchanged
|
||||
`${l.pathname.slice(0, -1)}${decoded ? `?${decoded}` : ''}${l.hash}` // Build the new URL
|
||||
);
|
||||
// Split by '&' and process each part
|
||||
const decodedParts = originalQuery
|
||||
.split('&')
|
||||
.filter(Boolean) // Remove empty parts
|
||||
.map(part => part.replace(/~and~/g, '&')); // Replace "~and~" with "&"
|
||||
|
||||
// Join the parts back into a valid query string
|
||||
const decodedQuery = decodedParts.join('&');
|
||||
|
||||
// Avoid applying the replacement if the query string is unchanged
|
||||
const newUrl = `${l.pathname.slice(0, -1)}${decodedQuery ? `?${decodedQuery}` : ''}${l.hash}`;
|
||||
if (newUrl !== l.href) {
|
||||
window.history.replaceState(null, '', newUrl);
|
||||
}
|
||||
}
|
||||
})(window.location);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="module" crossorigin src="/assets/index-BvOIUj_o.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-InsxKvgR.css">
|
||||
</head>
|
||||
|
Reference in New Issue
Block a user