Skip to content

Strip leading dot from file.ext to match Obsidian - #27

Merged
intellectronica merged 1 commit into
intellectronica:mainfrom
andriyor:fix-file-ext-dot
Oct 11, 2026
Merged

intellectronica merged 1 commit into
intellectronica:mainfrom
andriyor:fix-file-ext-dot

Conversation

@andriyor

Copy link
Copy Markdown
Contributor

Fixes #26.

Obsidian Bases exposes file.ext without the dot (md), but mdbasequery took it from path.extname and returned .md, so file.ext == "md" matched nothing.

Changes

  • Strip the leading dot in core everywhere a file record is built: indexed notes (vault-index.ts), the synthetic this.file for the base (query.ts) and link-derived file records (evaluator.ts). Runtime adapters' extname is unchanged.
  • New regression test: file.ext == "md" matches every note and projects "md".
  • Updated the existing this.file.ext == ".base" test and test fixtures to the dotless form.
  • Added a compatibility note to AGENTS.md.

Behaviour change

Queries written against the old value (file.ext == ".md") will stop matching. Worth a line in the release notes.

Checks

🤖 Generated with Claude Code

Obsidian Bases exposes file.ext as "md", but mdbasequery used
path.extname and returned ".md", so `file.ext == "md"` matched nothing.
Strip the dot in core for indexed notes, this.file and link-derived
file records; adapters keep returning the dotted extname.

Fixes intellectronica#26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@intellectronica
intellectronica merged commit 0e9c35f into intellectronica:main Oct 11, 2026
7 checks passed
@intellectronica

Copy link
Copy Markdown
Owner

Thank you for the contribution, @andriyor !

@intellectronica intellectronica mentioned this pull request Oct 11, 2026
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.

file.ext includes the leading dot (".md"), Obsidian uses "md"

2 participants