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,10 +67,14 @@ 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;
for (const node of p.childNodes) {
const color = parse_color(node.textContent);
if (color) return color; if (color) return color;
} }
} }
}
async function update_name_color(name: string) { async function update_name_color(name: string) {
const now = new Date(); const now = new Date();