From b3f809a116e19386f42d591e87873f8616ecb64f Mon Sep 17 00:00:00 2001 From: exyi Date: Mon, 5 Oct 2020 20:07:58 +0000 Subject: [PATCH] Remove annoying intoductory img from task assignment --- frontend/src/ksp-task-grabber.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/ksp-task-grabber.ts b/frontend/src/ksp-task-grabber.ts index 3ea4042..20974f6 100644 --- a/frontend/src/ksp-task-grabber.ts +++ b/frontend/src/ksp-task-grabber.ts @@ -103,6 +103,12 @@ function parseTask(startElementId: string, doc: HTMLDocument): TaskAssignmentDat e = e.nextElementSibling as HTMLElement } + // hack: remove img tag that shows this task is a practical one. Some tasks have it, some don't, so we remove it for consistency + const intoImgTag = elements[0]?.firstElementChild + if (intoImgTag && intoImgTag.tagName.toLowerCase() == "img" && intoImgTag.classList.contains("leftfloat")) { + intoImgTag.remove() + } + let r = "" for (const e of elements) { fixAllLinks(e)