harlan-zw / nuxt-link-checker

Find and magically fix links that may be negatively effecting your Nuxt sites SEO.
https://nuxtseo.com/link-checker
88 stars 10 forks source link

"Missing trailing slash" warning with URLs that contain a trailing hash #1

Closed Skyost closed 1 year ago

Skyost commented 1 year ago

Describe the bug

Hey,

As said here on https://github.com/harlan-zw/nuxt-simple-sitemap/issues/3, I've tried this package. I've used it without any problem, except when my URL contains a hash. For example :

Voir les <nuxt-link to="/#licence">licences</nuxt-link>.

Gives me :

 Missing trailing slash                                                                                                                                               nitro 13:28:38  
   <a href="/#licence" class="" data-v-f00c64f5="">licences</a>                                                                                                         nitro 13:28:38  
  ├─ / 

Same problem with URLs that contain some JS (eg. <a href="javascript:history.back()">previous page</a>) and for anchor links (eg. <a href="#anchor">anchor link</a>).

Thanks !

Reproduction

No response

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
    Memory: 5.53 GB / 15.35 GB
Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
    Edge: Spartan (44.22621.963.0), Chromium (108.0.1462.54)
    Internet Explorer: 11.0.22621.1


### Used Package Manager

npm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/harlan-zw/.github/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guide](https://github.com/antfu/contribute).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
harlan-zw commented 1 year ago

Hey @Skyost

Thanks, really appreciate your help in improving this and the sitemap module through your issues!

I've pushed up a fix for this which is available in 0.2.0.

Skyost commented 1 year ago

No problem, thanks for your great modules @harlan-zw 👍