fixed links to posts with & in their name not working
Some checks failed
Restart Website Service / restart_service (push) Has been cancelled

This commit is contained in:
Snorre 2025-04-01 15:33:51 +02:00
parent 2f2e494994
commit e7e8787e03

View file

@ -69,7 +69,7 @@
p.innerHTML = "Recent <a href=\"/posts\">posts</a>";
let elem = document.querySelector("#content>.content.posts>ul");
elem.innerHTML = posts.slice(0, 3).map(x => `<li><a href="/posts?post=${x}">${x}</a></li>`).join("\n");
elem.innerHTML = posts.slice(0, 3).map(x => `<li><a href="/posts?post=${encodeURI(x).replace(/&/, "%26")}">${x}</a></li>`).join("\n");
elem.style.maxWidth = "40ch";
elem.classList.add("posts");
})()