vernak2539 / astro-rehype-relative-markdown-links

Rehype Plugin for Astro that allows for usage of relative links between markdown files
https://www.npmjs.com/package/astro-rehype-relative-markdown-links
15 stars 4 forks source link

bug: does not work cross-platform (e.g., windows) #31

Closed techfg closed 7 months ago

techfg commented 7 months ago

There are a couple of issues present in a cross-platform (windows) environment:

  1. Links are not transformed correctly
  2. Plugin tests fail

Steps to reproduce links are not transformed correctly

  1. Clone repro at https://github.com/techfg/astro-rehype-relative-markdown-links-issue-31 on Windows machine
  2. npm install
  3. npm run dev
  4. Click on Docs Index Link
  5. Inspect the href using dev tools for Subdir Index & Subdir 1 anchor elements

Expected Result: URL should be /docs/subdir and /docs/subdir-1 respectively

Actual Result: URL is /docs\subdir/index and /docs\subdir/subdir-1 respectively

Steps to reproduce plugin tests fail

  1. Clone repro at https://github.com/vernak2539/astro-rehype-relative-markdown-links on Windows machine
  2. npm install
  3. npm run test

Expected Result: Tests pass

Actual Result: tests fail

vernak2539 commented 7 months ago

Released in v0.12.1. Thanks!