From c9293c59e11723f599b57d69add5fd85ef303879 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Wed, 17 Nov 2021 17:19:15 +0100 Subject: [PATCH] Fix linting issue --- src/scripts/pages/chemistry.ts | 11 ++++++----- src/scripts/pages/global.ts | 7 +++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/scripts/pages/chemistry.ts b/src/scripts/pages/chemistry.ts index 4d55a34..b211c1f 100644 --- a/src/scripts/pages/chemistry.ts +++ b/src/scripts/pages/chemistry.ts @@ -204,12 +204,13 @@ export function chemistryScript(root: HTMLElement): void { ); registerSearchEntries( - Array.from(root.querySelectorAll("table.wikitable > tbody > tr:not(:first-child) th .reagent-header")).map((element, id) => ({ + Array.from( + root.querySelectorAll( + "table.wikitable > tbody > tr:not(:first-child) th .reagent-header" + ) + ).map((element, id) => ({ page: "Guide_to_chemistry", - name: element - .textContent.trim() - .replace(/\n.+$/gm, "") - .replace("▮", ""), + name: element.textContent.trim().replace(/\n.+$/gm, "").replace("▮", ""), element, alignment: "center", id, diff --git a/src/scripts/pages/global.ts b/src/scripts/pages/global.ts index 089ac03..c0058d8 100644 --- a/src/scripts/pages/global.ts +++ b/src/scripts/pages/global.ts @@ -75,7 +75,7 @@ export function processGlobal(root: HTMLElement, docname: string): void { if (toc) { const tocHeader = toc.querySelector("h2"); toc.parentNode.insertBefore(tocHeader, toc); - const tocTitle = toc.querySelector("#toctitle") + const tocTitle = toc.querySelector("#toctitle"); if (tocTitle != null) { toc.removeChild(tocTitle); } @@ -102,7 +102,10 @@ export function processGlobal(root: HTMLElement, docname: string): void { const container = findParent(span, (el) => el.classList.contains("mw-headline-cont") ); - if (container && container.querySelectorAll(".mw-headline").length === 1) { + if ( + container && + container.querySelectorAll(".mw-headline").length === 1 + ) { container.id = span.id; span.id += "-span"; container.dataset.name = span.textContent;