fix: allow link elements as well as a

This commit is contained in:
ThatOneCalculator 2023-07-16 20:31:15 -07:00
parent d23b6c2b66
commit 2da6168831
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -7,7 +7,8 @@ export async function getRelMeLinks(url: string): Promise<string[]> {
const dom = new JSDOM(html);
const relMeLinks = [
...dom.window.document.querySelectorAll("a[rel='me']"),
].map((a) => (a as HTMLAnchorElement).href);
...dom.window.document.querySelectorAll("link[rel='me']"),
].map((a) => (a as HTMLAnchorElement | HTMLLinkElement).href);
return relMeLinks;
} catch {
return [];