Skip to content

Clean copied links without requiring a URL scheme - #13

Merged
HexCodeYT merged 1 commit into
mainfrom
dev/fix-schemeless-links
Jul 26, 2026
Merged

HexCodeYT merged 1 commit into
mainfrom
dev/fix-schemeless-links

Conversation

@HexCodeYT

Copy link
Copy Markdown
Owner

What changed

  • Recognizes full http:// and https:// URLs, schemeless host/path links, and protocol-relative //host/path links.
  • Preserves the input form instead of adding a scheme.
  • Uses the recognized host for the same global and domain-specific cleaning rules used by full URLs.
  • Rejects ambiguous ordinary text, email-like strings, relative paths, whitespace-containing input, and unsupported schemes.
  • Preserves support for schemeful single-label hosts such as intranet URLs.
  • Adds unit and fixture coverage for the reported youtu.be/... failure.

Root cause

clean_url had a hard gate that accepted only strings beginning with http:// or https://. Clipboard and CLI callers both use this function, so every otherwise-valid copied link without a scheme was returned unchanged before rule matching.

Verification

The exact reported command now returns:

youtu.be/LYa_ReqRlcs

Also verified schemeless YouTube, generic global tracking, protocol-relative links, ambiguous non-URLs, and schemeful intranet URLs.

  • cargo fmt --check
  • cargo test — 19 unit tests plus fixture/integration suites pass
  • cargo clippy --all-targets -- -D warnings
  • native app smoke test and Preview 3 package/checksum verification

@HexCodeYT
HexCodeYT marked this pull request as ready for review July 26, 2026 11:25
@HexCodeYT
HexCodeYT merged commit 2abb7cc into main Jul 26, 2026
2 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