remarkjs / remark-validate-links

plugin to check that Markdown links and images reference existing files and headings
https://remark.js.org
MIT License
109 stars 26 forks source link

Multiple hyphens in a row are not collapsed in headings #55

Closed oleorhagen closed 4 years ago

oleorhagen commented 4 years ago

Multiple hyphens in a row are not collapsed in headings

Given a heading:

# step 1 - foo bar bz

[](#step-1-foo-bar-bz)

The link checker will output:

 52:1-52:60  warning  Link to unknown heading: `step-1-foo-bar-bz`. Did you mean `step-1---foo-bar-bz`  missing-heading  remark-validate-links

Which is wrong at least according to Gitlab

Where

  1. Two or more hyphens in a row are converted to one.

Which I guess means this is an error on the link-checkers part?

Your environment

Steps to reproduce

Run the checker on the file above

wooorm commented 4 years ago

Run the checker on the file above

What is the remote that you have configured?


This project adheres to GitHub slugging: https://gist.github.com/wooorm/482844e0dc156c08bfc490d2ab4fa4fa#step-1---foo-bar-bz

I was under the impression that GitLab followed GitHub. This is unfortunate.

oleorhagen commented 4 years ago

Run the checker on the file above

What is the remote that you have configured?

This project adheres to GitHub slugging: https://gist.github.com/wooorm/482844e0dc156c08bfc490d2ab4fa4fa#step-1---foo-bar-bz

I was under the impression that GitLab followed GitHub. This is unfortunate.

Indeed. I did a test now though, and it is correct on Gitlab also. I guess this means it is only on our Grav doc site it does not :/

I guess that means I will do this locally.

Any pointers on how I should go about fixing this?

wooorm commented 4 years ago

I did a test now though, and it is correct on Gitlab also.

So it seems like GL probably does step 4 before step 3? (edit: or that those docs are outdated) 🤔🤷‍♂️ OK, good to know, but then we don’t need to do anything here. I’ll close this then!

Any pointers on how I should go about fixing this?

Yup, see: https://github.com/remarkjs/remark-validate-links/issues/40

oleorhagen commented 4 years ago

Thanks