(root: ET.Element)
| 136 | |
| 137 | |
| 138 | def _extract_atom_html_url(root: ET.Element) -> str: |
| 139 | fallback = "" |
| 140 | for child in list(root): |
| 141 | if strip_namespace(child.tag) != "link": |
| 142 | continue |
| 143 | href = normalize_url(child.attrib.get("href", "")) |
| 144 | if not href: |
| 145 | continue |
| 146 | rel = (child.attrib.get("rel", "alternate") or "alternate").strip().lower() |
| 147 | if rel in {"alternate", ""}: |
| 148 | return href |
| 149 | if not fallback: |
| 150 | fallback = href |
| 151 | return fallback |
| 152 | |
| 153 | |
| 154 | def _build_feed_metadata(root_name: str, title: str, html_url: str, feed_url: str) -> FeedMetadata: |
no test coverage detected