name-color: even better at finding names now

This commit is contained in:
mehbark 2024-07-11 17:37:00 -04:00
parent d9ced1a44c
commit 42b1b4ecc0

View file

@ -67,8 +67,12 @@ async function get_name_color(name: string): Promise<string | undefined> {
} }
for (const p of dom.querySelectorAll("p")) { for (const p of dom.querySelectorAll("p")) {
const color = parse_color(p.textContent); if (!p.textContent.includes("name-color:")) continue;
if (color) return color;
for (const node of p.childNodes) {
const color = parse_color(node.textContent);
if (color) return color;
}
} }
} }