Validating Relative Paths and Anchor Links

External HTTP links are straightforward to check, but relative paths and in-page anchors common in multi-file documentation projects require special handling. The Markdown Link Checker includes a virtual file tree feature that enables accurate validation of these internal references entirely in the browser.

Relative links like ./images/logo.png or ../guide/install.md rely on project structure. Anchor links such as #installation point to headings within the same or linked documents. Without context, these appear broken during simple validation.

The Virtual File Tree

Available in the configuration panel, the virtual file tree accepts a simple text representation of your project directory. List files and folders using standard indentation or JSON-like syntax to mirror actual paths.

Once defined, the tool resolves relative paths against this structure. Missing files or incorrect paths receive Broken status with clear indications, while valid ones mark as Valid.

Anchor Link Validation

In-page anchors are checked automatically against headings extracted from the current document. Links to #non-existent-section flag as broken, helping catch typos early.

When combined with the virtual tree, cross-document anchors like other-file.md#setup resolve properly if the target file exists in the defined structure and contains the heading.

Setting Up the Tree

Start with a basic list of your main Markdown files and key folders. For small sites, a flat list suffices. Larger documentation benefits from nested representation showing subdirectories.

The format is flexible and forgiving—focus on accurate relative paths from your entry file. Update the tree as your project grows or restructures.

Benefits for Projects

Static site generators like Jekyll, Hugo, or MkDocs produce complex relative link networks. Validating these locally before build catches issues early.

Open-source repositories with extensive docs folders gain confidence that internal navigation works across branches. Technical writers working on book-style guides ensure chapter links remain intact.

Limitations and Tips

The virtual tree is client-side only and session-based—no data leaves your browser. For very large projects, include only relevant subsections to keep input manageable.

Combine with ignore patterns for assets like images if you prefer to focus solely on Markdown navigation.

Enabling full internal validation transforms the tool from external checker to complete project auditor.

Accurate relative and anchor validation keeps complex documentation reliable and user-friendly.

Build confidence in your internal links with the virtual file tree.