You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
links: URL-scheme rules disagree across validate, links.mjs and page-checks #83
Why it matters
Three modules each decide what counts as an external link. validate.mjs accepts ftp: body links, links.mjs treats only http(s) and mailto: as external, so an ftp:// link validates but then fails the build with the misleading error link target "ftp://…" does not exist. page-checks.mjs whitelists data: hrefs while rule V16 in checks.mjs rejects data: entry URLs, so a build-only run never catches a data: URL. Also, markdown.mjs rejects a line that starts with an autolink <https://…> as raw HTML although renderInline supports autolinks mid-line.
Evidence (reproduced)
site/validate.mjs:172 vs site/lib/links.mjs:9 vs site/lib/page-checks.mjs:83 vs site/checks.mjs:605.
site/lib/markdown.mjs:339/^\s*<[A-Za-z!/]/ vs :312.
Suggested approach
One EXTERNAL_SCHEME_RE exported from site/lib/shared.mjs and used by all four places; a dedicated "unsupported scheme" LinkError with the scheme in the message; change the raw-HTML guard to /^\s*<(?!https?:\/\/)[A-Za-z!/]/. Tests for ftp:, data:, javascript: and a line-start autolink.
Done when
The same URL is accepted or rejected identically by validate, build and the page checks, with one message that names the scheme.
Activity
Open issues sweep: validation types, incremental build, added dates, …
TMHSDigital commentedon Oct 22, 2026
Resolved by #124, merged to main in 1e1cfb8.