Unverified Commit 9a58aeda authored by Hong Minhee's avatar Hong Minhee
Browse files

Support multiple `rel` attribute values in `<link>` elements

parent b474f726
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@ Version 1.2.3

To be released.

 -  The `fedify node` subcommand now can recognize multiple values of
    the `rel` attribute in the `<link>` HTML elements.


Version 1.2.2
-------------
+2 −1
Original line number Diff line number Diff line
@@ -219,7 +219,8 @@ async function getFaviconUrl(url: string | URL): Promise<URL> {
        ? value.slice(1, -1)
        : value;
    }
    if (attrs.rel !== "icon" && attrs.rel !== "apple-touch-icon") continue;
    const rel = attrs.rel?.toLowerCase()?.trim()?.split(/\s+/) ?? [];
    if (!rel.includes("icon") && !rel.includes("apple-touch-icon")) continue;
    if ("sizes" in attrs && attrs.sizes.match(/\d+x\d+/)) {
      const [w, h] = attrs.sizes.split("x").map((v) => Number.parseInt(v));
      if (w < 38 || h < 19) continue;