Skip to content

fix: exclude URI-scheme links (tel:, mailto:, etc.) from unresolved reference diagnostics - #415

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1773885929-fix-tel-unresolved-reference
Open

fix: exclude URI-scheme links (tel:, mailto:, etc.) from unresolved reference diagnostics#415
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1773885929-fix-tel-unresolved-reference

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #413tel: links (and other non-http URI schemes like mailto:, ftp:, etc.) were incorrectly flagged as "Unresolved Reference" by the diagnostics system.

The root cause: generic_link_constructor only filtered out http://, https://, and data: schemes. Any other URI scheme (e.g. tel:+12345678901) was treated as a file path reference, which then couldn't resolve to any file.

This PR replaces the three hardcoded starts_with checks with a general-purpose has_uri_scheme() function that detects any valid RFC 3986 URI scheme (ALPHA *(ALPHA / DIGIT / "+" / "-" / ".") ":"). A minimum scheme length of 2 characters is enforced to avoid matching Windows drive letter paths like C:\.

Review & Testing Checklist for Human

  • False positive risk with general scheme detection: The old code only skipped 3 explicit schemes; now any path matching XX+:... (2+ chars before colon) is skipped. Consider whether any legitimate vault file paths could contain colons that would be incorrectly filtered (e.g. on Linux, filenames with colons are technically valid).
  • End-to-end verification: Open a markdown file containing [+1 (234) 567 8901](tel:+12345678901) in an editor with markdown-oxide and confirm no "Unresolved Reference" diagnostic appears. Also verify that normal internal links (wikilinks and md-links) still produce diagnostics when unresolved.

Notes

  • The colon >= 2 threshold was chosen to avoid Windows drive letters (C:\). No registered IANA URI scheme is a single character, so this should be safe in practice.
  • Three new unit tests were added: has_uri_scheme_detection, tel_link_not_parsed_as_reference, and mailto_link_not_parsed_as_reference.
  • Doc comment misplacement (flagged by Devin Review) was fixed in follow-up commit — has_uri_scheme and has_non_markdown_extension now each have their own correctly attributed doc comments.

Link to Devin session: https://app.devin.ai/sessions/3b678a7bfdd14b668c231efd4b8dc916
Requested by: @Feel-ix-343


Open with Devin

…eference diagnostics

Replaces the hardcoded http/https/data scheme checks with a general
URI scheme detector (has_uri_scheme). Any link whose path starts with a
valid RFC 3986 scheme (2+ chars before the colon) is now skipped during
reference construction, preventing false 'Unresolved Reference'
diagnostics for tel:, mailto:, ftp:, and other URI-scheme links.

Closes #413

Co-Authored-By: Felix Zeller <felixazeller@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Felix Zeller <felixazeller@gmail.com>
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.

Unresolved Reference for Tel Links

1 participant