Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
we extract them alongside the images and let the model match figures to captions.
"""
import argparse, json, re, subprocess, sys
from urllib.parse import urlparse
from pathlib import Path

# Make `utils` importable when this file is run directly (mirrors the pattern in
Expand Down Expand Up @@ -806,7 +807,9 @@ def parse_metadata(text: str) -> dict:
continue
if "arxiv.org" in url:
continue
if "github.io" in url or is_project_line or re.search(r"\.(io|dev|page)/", url):
parsed_host = urlparse(url).hostname or ""
is_github_io = parsed_host == "github.io" or parsed_host.endswith(".github.io")
if is_github_io or is_project_line or re.search(r"\.(io|dev|page)/", url):
candidates.append(url)
if candidates:
metadata["project_url"] = candidates[0]
Expand Down