format: run prettify

This commit is contained in:
SethBurkart123
2025-05-05 18:04:10 +10:00
parent 771169348f
commit 0f9f618164
142 changed files with 28768 additions and 20790 deletions
@@ -1,24 +1,24 @@
export function RemoveShortcutDiv(elements: any) {
if (elements.length === 0) return
if (elements.length === 0) return;
elements.forEach((element: any) => {
const shortcuts = document.querySelectorAll(".shortcut")
const shortcuts = document.querySelectorAll(".shortcut");
shortcuts.forEach((shortcut) => {
const anchorElement = shortcut.parentElement // the <a> element is the parent
const textElement = shortcut.querySelector("p") // <p> is a direct child of .shortcut
const title = textElement ? textElement.textContent : ""
const anchorElement = shortcut.parentElement; // the <a> element is the parent
const textElement = shortcut.querySelector("p"); // <p> is a direct child of .shortcut
const title = textElement ? textElement.textContent : "";
let shouldRemove = title === element.name
let shouldRemove = title === element.name;
// Check href only if element.url exists
if (element.url) {
shouldRemove =
shouldRemove && anchorElement!.getAttribute("href") === element.url
shouldRemove && anchorElement!.getAttribute("href") === element.url;
}
if (shouldRemove) {
anchorElement!.remove()
anchorElement!.remove();
}
})
})
}
});
});
}