diff --git a/legacy.html b/legacy.html
index dea5c23..6fe259f 100644
--- a/legacy.html
+++ b/legacy.html
@@ -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);