name-color: even better at finding names now
This commit is contained in:
parent
d9ced1a44c
commit
42b1b4ecc0
1 changed files with 6 additions and 2 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue