gaurav-nelson/github-action-markdown-link-check

Title Links Not Working in 1.0.14

Closed this issue ยท 7 comments

In the latest release, I notice links to title sections are now marked as broken.
ie.

[Dependencies](#Dependencies)

# Dependencies
This markdown example has no dependencies.

I can work around this with configuration, but I wanted to check if this was the desired behaviour?

Thank you @niall-byrne, Can you verify this with v1.0.15 ?

@gaurav-nelson: I can confirm this does indeed happen with v1.0.15. After seeing my prior issue #170 was fixed in v1.0.15, I went to point at that version in my production config only to find the linkchecks of anchor links like these were broken, so that's when I searched & found this issue. I've just reproduced it in my test repo https://github.com/philrz/linkcheck: The check for [Dependencies](#Dependencies) passed ok when I had it pointing @v1 but it fails when pointing @1.0.15. I notice that @niall-byrne's paste shows what looks to be incorrect syntax [Dependencies][#Dependencies] (two sets of square brackets) but I have it failing with [Dependencies](#Dependencies).

@philrz I think the correct markdown anchor should be:

[Dependencies][#dependencies]
...
...
# Dependencies
This markdown example has no dependencies.

Because href is always generated like that (d vs D). Its working fine on GitHub because they maybe using some scripts.

Can you recheck with this change?

@gaurav-nelson: Ah yes, thanks for spotting the importance of the capitalization. I did the proposed recheck and indeed now that it's a lowercase d the checker @1.0.15 is passing with that test README. So, that's great!

However, I've still got a problem with my production markdown, and unfortunately it doesn't seem to be a problem with capitalization. I've copied the markdown into my test repo at https://github.com/philrz/linkcheck/blob/main/zng.md if you're up for taking a look. The output of the Actions run with verbose mode enabled shows:

FILE: ./zng.md
  [โœ“] https://avro.apache.org/ โ†’ Status: 200
  [โœ“] https://en.wikipedia.org/wiki/Apache_Parquet โ†’ Status: 200
  [โœ“] https://developers.google.com/protocol-buffers โ†’ Status: 200
  [โœ“] https://kafka.apache.org/ โ†’ Status: 200
  [โœ“] #21-types-frame โ†’ Status: 200
  [โœ–] #22-values-frame โ†’ Status: 404
  [โœ–] #23-control-frame โ†’ Status: 404

  7 links checked.

  ERROR: 2 dead links found!
  [โœ–] #22-values-frame โ†’ Status: 404
  [โœ–] #23-control-frame โ†’ Status: 404```

What's strange is that if you look in the doc you'll see these links all appear right next to each other:

* [types frame](#21-types-frame),
* [values frame](#22-values-frame), or
* [control frame](#23-control-frame).

And the section headers for each are:

### 2.1 Types Frame
### 2.2 Values Frame
### 2.3 Control Frame

And for some reason it thought the Types Frame one was ok but the other two were a 404, but I can't for the life of me see why they're treated differently. I'd appreciate any insight you might have. Thanks!

Thank you @philrz I ran through that file locally with markdown-link-check and got the same result. I'm not sure what is wrong here, but this issue is with the underlying markdown-link-check library and not the GitHub action. I suggest to close this one and create an issue at https://github.com/tcort/markdown-link-check/issues

Thanks @gaurav-nelson. I've opened tcort/markdown-link-check#250. Will see what they say.

I'll close this issue given the upstream library is being investigated.