Skip to content

0.4.1: any URI scheme is an external link, not a fixed list - #15

Open
emircanerol wants to merge 1 commit into
m4bwav:masterfrom
emircanerol:fix/uri-scheme-links
Open

emircanerol wants to merge 1 commit into
m4bwav:masterfrom
emircanerol:fix/uri-scheme-links

Conversation

@emircanerol

@emircanerol emircanerol commented Nov 7, 2026 •

Copy link
Copy Markdown

Problem

vault_lint.py skipped only a fixed list of link prefixes (http://, https://, mailto:, obsidian://, file://, ftp://, tel:) and read every other target as a relative path. Paper notes linked to their Zotero items, e.g.

[Zotero'da aç](zotero://select/library/items/ABCD1234) · [PDF](zotero://open-pdf/library/items/EFGH5678)

were therefore reported as broken markdown links. The same applies to vscode://, doi: and any other app scheme.

Change

  • scripts/vault_lint.py: the EXTERNAL tuple is replaced by URI_SCHEME_RE = r"[A-Za-z][A-Za-z0-9+.-]+:" (an RFC 3986 scheme). The scheme must be at least two characters, so a Windows drive path (C:/x.md, C:\x.md) is still checked as a path.
  • scripts/test_vault_lint.py: case 14 covers zotero://select, zotero://open-pdf, vscode://, doi:, and a reference-style definition, and checks that a C:/ path is still reported as broken. Both checks fail on the old code.
  • CHANGELOG C-20261108-1, both plugin.json files bumped to 0.4.1, and a line added to ai-docs/log.md. SKILL.md is unchanged.

Verification

  • python skills/obsidian-notes/scripts/test_vault_lint.py: all checks pass.
  • python tests/test_repo.py: all checks pass.
  • vault_lint.py . --exclude fixtures: 0 errors, 0 warnings.
  • On a copy of a real literature vault (835 markdown files) with Zotero links added to two notes, the old code reports 4 zotero false positives and the new code reports 0. On vaults without such links, old and new code give identical results.

The lint skipped only http, https, mailto, obsidian, file, ftp and tel
targets and read every other link as a relative path, so app links such
as zotero://select/... and zotero://open-pdf/... in paper notes were
reported as broken markdown links.

- vault_lint.py: EXTERNAL prefix tuple replaced by URI_SCHEME_RE
  (RFC 3986 scheme: a letter, then letters, digits, + . -, then a
  colon). Two characters at least, so a Windows drive path (C:/x.md,
  C:\x.md) is still checked as a path.
- test_vault_lint.py: case 14 (zotero://, vscode://, doi:, a reference
  definition; a C:/ path still reported broken).
- CHANGELOG C-20261108-1; both plugin.json files 0.4.1; ai-docs/log.md.
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