Skip to content

fix: preserve static asset link extensions#65

Merged
jrepp merged 2 commits into
mainfrom
fix/static-asset-link-validation
May 28, 2026
Merged

fix: preserve static asset link extensions#65
jrepp merged 2 commits into
mainfrom
fix/static-asset-link-validation

Conversation

@jrepp

@jrepp jrepp commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve explicit file extensions when validating relative local links, fixing static asset links like ../static/rfc-001/*.png
  • normalize local Markdown link targets by stripping query strings/fragments and URL-decoding filesystem paths before validation
  • apply the same local target cleanup to configured document-index link extraction
  • add regression and edge-case coverage for static assets, query/anchor suffixes, URL-escaped names, extensionless .md fallback, and document indexes

Regression

docuchango validate in 1.18.1 appended .md to every relative link target that did not already end in .md. That made valid asset links such as ../static/rfc-001/hcp-vault-radar-architecture.png resolve as ../static/rfc-001/hcp-vault-radar-architecture.png.md, producing false broken-link errors. Version 1.18.0 did not report those asset links as broken.

This PR keeps the intended fallback for extensionless document links, but only when the cleaned local path has no suffix. Links that already point at concrete files such as .png, .svg, or other assets are validated as-is.

Lateral Checks

  • relative static asset links no longer receive a .md suffix
  • asset links with ?query and #fragment validate against the underlying file
  • URL-escaped local filenames, for example %20, validate against decoded filesystem paths
  • extensionless document links still resolve to .md
  • document index validation uses the same target cleanup for extensionless links with query/anchor suffixes

Tests

  • uv run --python 3.13 --extra test python -m pytest tests/test_link_validation.py tests/test_document_indexes.py

@jrepp jrepp merged commit 726d955 into main May 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant