Fix linting issue
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Hamcha 2021-11-17 17:19:15 +01:00
parent e49a3b43fd
commit c9293c59e1
Signed by: Hamcha
GPG Key ID: 1669C533B8CF6D89
2 changed files with 11 additions and 7 deletions

View File

@ -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,

View File

@ -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;