Browse Source

Fix linting issue

master
Hamcha 3 weeks ago
parent
commit
c9293c59e1
Signed by: Hamcha GPG Key ID: 1669C533B8CF6D89
  1. 11
      src/scripts/pages/chemistry.ts
  2. 7
      src/scripts/pages/global.ts

11
src/scripts/pages/chemistry.ts

@ -204,12 +204,13 @@ export function chemistryScript(root: HTMLElement): void {
);
registerSearchEntries(
Array.from(root.querySelectorAll<HTMLElement>("table.wikitable > tbody > tr:not(:first-child) th .reagent-header")).map((element, id) => ({
Array.from(
root.querySelectorAll<HTMLElement>(
"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,

7
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<HTMLElement>(".mw-headline").length === 1) {
if (
container &&
container.querySelectorAll<HTMLElement>(".mw-headline").length === 1
) {
container.id = span.id;
span.id += "-span";
container.dataset.name = span.textContent;

Loading…
Cancel
Save