chore: fixes

This commit is contained in:
MattTheTekie 2026-04-23 18:23:07 -04:00
commit ecb85e31f5

View file

@ -152,25 +152,25 @@ function showAbout(event) {
return;
}
const startImg = section.querySelector('img[src*="kirby19.gif"]');
const img = section.querySelector('img[src*="kirby19.gif"]');
if (!startImg) {
if (!img) {
target.innerHTML = section.outerHTML;
return;
}
// Build a new container starting from Kirby
const newSection = document.createElement("div");
newSection.id = "aboutSection";
// Use Range to extract everything from Kirby onward properly
const range = document.createRange();
range.setStartBefore(img);
range.setEndAfter(section.lastChild);
let node = startImg;
const fragment = range.cloneContents();
while (node) {
newSection.appendChild(node.cloneNode(true));
node = node.nextSibling;
}
const wrapper = document.createElement("div");
wrapper.id = "aboutSection";
wrapper.appendChild(fragment);
target.innerHTML = newSection.outerHTML;
target.innerHTML = wrapper.innerHTML;
})
.catch(err => {
console.error(err);