akabekobeko / npm-gatsby-remark-copy-relative-linked-files

Copies local files relative linked to/from markdown to your public folder with preserve directory structure.
MIT License
6 stars 3 forks source link

Windows cannot handle paths properly #27

Closed akabekobeko closed 3 years ago

akabekobeko commented 3 years ago

refs #22

Windows cannot handle paths properly.

gatsby-remark-copy-relative-linked-files › Plugin › image › Copy

    expect(received).toBe(expected) // Object.is equality

    Expected: "/sample.jpg"
    Received: "\\sample.jpg"

      166 |
      167 |         expect(FsExtra.copy).toHaveBeenCalled()
    > 168 |         expect(markdownAST.children[0].children[0].url).toBe(`/${path}`)
          |                                                         ^
      169 |       })
      170 |
      171 |       test('Copy with linkPrefix', async () => {

      at Object.<anonymous> (src/index.test.js:168:57)
akabekobeko commented 3 years ago

It may be possible to fix it by using upath.

akabekobeko commented 3 years ago

On Windows, upath now treats path delimiters as /. The Windows test is also green, so close it.