diff --git a/CHANGES.md b/CHANGES.md index 4c15bd8..2d96882 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -33,6 +33,15 @@ To be released. [#162]: https://github.com/dahlia/fedify/issues/162 +Version 1.2.3 +------------- + +Released on November 6, 2024. + + - The `fedify node` subcommand now can recognize multiple values of + the `rel` attribute in the `` HTML elements. + + Version 1.2.2 ------------- diff --git a/cli/node.ts b/cli/node.ts index 3d80c66..8ad3bca 100644 --- a/cli/node.ts +++ b/cli/node.ts @@ -237,7 +237,8 @@ async function getFaviconUrl( ? 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;