From 42b1b4ecc0fde84644372d9b2462ba98e37cab9b Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 11 Jul 2024 17:37:00 -0400 Subject: [PATCH] name-color: even better at finding names now --- serverside/name-color.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/serverside/name-color.ts b/serverside/name-color.ts index 03cbb4a..c101f77 100644 --- a/serverside/name-color.ts +++ b/serverside/name-color.ts @@ -67,8 +67,12 @@ async function get_name_color(name: string): Promise { } for (const p of dom.querySelectorAll("p")) { - const color = parse_color(p.textContent); - if (color) return color; + if (!p.textContent.includes("name-color:")) continue; + + for (const node of p.childNodes) { + const color = parse_color(node.textContent); + if (color) return color; + } } }