Skip to content

Preserve relative URL path semantics. - #18

Merged
samuel-williams-shopify merged 2 commits into
mainfrom
fix-relative-directory-references
Aug 14, 2026
Merged

Preserve relative URL path semantics.#18
samuel-williams-shopify merged 2 commits into
mainfrom
fix-relative-directory-references

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Correct relative path generation when a target identifies the current directory, shares its final segment with the base directory, or begins with a segment that could be interpreted as a URI scheme.

This ensures:

  • / relative to /index becomes ./.
  • /docs/ relative to /docs/index becomes ./.
  • /docs relative to /docs/index becomes ../docs.
  • /docs/this:that relative to /docs/index becomes ./this:that.

An empty URI reference identifies the current document, and a colon in the first segment can be interpreted as a URI scheme.

Testing

  • bundle exec sus
  • bundle exec rubocop lib/protocol/url/path.rb test/protocol/url/path.rb test/protocol/url/relative.rb
  • git diff --check

@samuel-williams-shopify
samuel-williams-shopify merged commit 1b8bfa2 into main Aug 14, 2026
40 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the fix-relative-directory-references branch August 14, 2026 08:34
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