Alcea
|
cedbc339ee
|
Add files via upload
Add instance perma link via
postElement.appendChild(quoteBlock);
}
//link2acws
// Function to decode surrogate pairs and Unicode escapes from JSON string literal
function decodeUnicodeEscapes(str) {
return str.replace(/\\u([\dA-Fa-f]{4})/g, (_, hex) =>
String.fromCharCode(parseInt(hex, 16))
);
}
if (value.includes("•acws")) {
// Step 1: decode the literal Unicode escapes (\ud809\udc2b) to real characters
const decodedValue = decodeUnicodeEscapes(value);
const formattedValue = decodedValue.replace(/𒐫(.*?)𒐫/g, '<blockquote>$1</blockquote>');
const dateClean = date.replace(/-/g, '');
const hash = CryptoJS.MD5(formattedValue).toString().substring(0, 8);
const permalink = `https://alceawis.com/alceawis/status/${dateClean}-${hash}`;
// Step 4: create and append link
const link = document.createElement('a');
link.href = permalink;
link.target = "_blank";
link.textContent = 'Permalink';
link.classList.add('btn2');
postElement.appendChild(link);
}
postElement.appendChild(hashtagsElement);
|
2025-07-19 15:49:47 +02:00 |
|