(value: Any)
| 210 | return text |
| 211 | |
| 212 | |
| 213 | def _doi_url(value: Any) -> str: |
| 214 | text = str(value or "").strip() |
| 215 | if not text: |
| 216 | return "" |
| 217 | if text.startswith(("http://", "https://")): |
| 218 | return text |
| 219 | if text.lower().startswith("doi.org/"): |
| 220 | return f"https://{text}" |
| 221 | doi = _doi_value(text) |
| 222 | return f"https://doi.org/{doi}" if doi else "" |
| 223 | |
| 224 |
no test coverage detected