Automatically repair Markdown links and images when files are moved or renamed.
When you move src/file.cs somewhere new, the link [guide](https://github.com/tarasermolenko/MDLinks/blob/HEAD/../src/file.cs) in your Markdown silently breaks. This extension detects the move, finds where the file went, and updates the link.
Preserving its style exactly (relative stays relative, fragments and queries are preserved, only the URL token is changed).
Features
Auto-detect file moves — when you rename or move a file in VS Code's explorer, the extension offers to scan Markdown for any references to the old path and fix them.
Deleted-file warnings — delete a file and the extension warns you if any Markdown links still point to it (these can't be auto-fixed — the file is gone), listing exactly where they are.
Command palette commands — manually trigger a workspace scan, current-file scan, or dry-run preview.
Interactive disambiguation — when a moved file matches multiple candidates, you pick the right one from a quick-pick menu.
Pure rewrite — only the URL token changes. Formatting, surrounding text, titles, and anchors are untouched.
Commands
Command
What it does
Fix Refs: Repair broken references in workspace
Scan every Markdown file in the workspace and fix all detectable references.
Fix Refs: Repair broken references in current file
Only scan the Markdown file you currently have open.
Fix Refs: Preview workspace fixes (dry run)
Show what would change without writing any files.
Settings
Setting
Default
Description
fixRefs.autoFixOnRename
true
When a file is moved or renamed, offer to fix Markdown references to its old path.
fixRefs.warnOnDelete
true
When a file is deleted, warn if any Markdown links still point to it.
fixRefs.exclude
[]
Extra glob patterns to ignore when scanning.
How it works
The extension is a thin VS Code shell over the fix-refs library, which parses Markdown into an AST and rewrites only the URL token of broken links.
Everything else in the document stays byte-for-byte unchanged. See package's README for the full mechanics.
On top of the library, the extension also listens for VS Code's file rename/move events, so it can catch files that were renamed (not just moved). When a file is renamed, the mapping is passed straight to the fixer, which lets it repair references the path-based search alone couldn't detect.
Requirements
VS Code 1.75 or later
Node.js 18 or later (bundled with VS Code on most platforms)