Skip to content

Windows: broken wiki links due to path separator in parseSections/extractRefs #55

@sgeier

Description

@sgeier

Environment

  • lat.md version: 0.11.0
  • OS: Windows 10
  • Shell: bash (Git Bash / WSL)

Problem

On Windows, all [[wiki-links]] resolve as broken when running lat check. The lat locate command also returns no results.

Root cause

In dist/src/lattice.js, parseSections and extractRefs use Node's path.relative() which returns backslash-separated paths on Windows (e.g. lat.md\architecture). The buildFileIndex function splits on /, so it produces an empty index on Windows — causing all wiki links to fail resolution.

Reproduction

  1. Install lat.md on Windows: npm install lat.md
  2. Create a lat.md/ directory with two pages that cross-link via [[page-name]]
  3. Run lat check — all wiki links report as broken
  4. Run lat locate "Section Name" — returns no results

Fix

Normalize paths to forward slashes after path.relative() calls in parseSections and extractRefs:

const relativePath = relative(basePath, filePath).replace(/\/g, '/');

Workaround

Running on Linux/macOS (e.g. CI) is not affected. Local Windows development shows false positives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions