UmbrellaDocs / linkspector

Uncover broken links in your content.
Apache License 2.0
55 stars 8 forks source link

Links to upper directories fail in md files #27

Closed marcindulak closed 2 months ago

marcindulak commented 4 months ago

The example below uses docker https://github.com/UmbrellaDocs/linkspector/pull/23

  1. build the image of the latest linkspector from source
    git clone https://github.com/UmbrellaDocs/linkspector
    cd linkspector
    docker build --build-arg LINKSPECTOR_PACKAGE= -t umbrelladocs/linkspector .
  2. run linkspector check on a test directory
    mkdir -p test/nested
    cp .gitignore test  # due to https://github.com/UmbrellaDocs/linkspector/issues/24
    echo '[test-relative](../test.md)' > test/nested/nested.md
    echo '[nested-absolute](/nested/nested.md)' > test/test.md
    echo '[nested-relative](./nested/nested.md)' >> test/test.md
    docker run --rm -it -v $PWD/test:/app --name linkspector umbrelladocs/linkspector bash -c 'linkspector check'

Output

⠋ Configuration file not found. Using default configuration.
🚫 nested/nested.md, ../test.md, 404, 1, Cannot find: ../test.md.
❌ Error: Some links in the specified files are not valid.

It is expected that 'linkspector check' passes. It is a reproduction example for https://github.com/UmbrellaDocs/linkspector/issues/22