Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anchor link checking is broken #225

Open
OmarTawfik opened this issue Dec 8, 2022 · 3 comments
Open

anchor link checking is broken #225

OmarTawfik opened this issue Dec 8, 2022 · 3 comments

Comments

@OmarTawfik
Copy link

OmarTawfik commented Dec 8, 2022

Thanks for the awesome linter. Long time user, first time contributor.
I have a bunch of files that define HTML code blocks, with id attributes:

<code id="foo"> .... </code>
<code id="bar"> .... </code>

Then I have some links that reference them:

<a href="#foo"> ... </a>
<a href="../other-file/#bar"> ... </a>

After upgrading to the latest version 3.10.3, it broke CI because of new errors everywhere. I traced it down to the following issues:

  1. The linter doesn't collect links from id attributes. So any links pointing to it (like href="#foo") produce errors.
  2. The linter doesn't lint href attributes that have a file path AND a header.
    1. href=".#id" for the same markdown file.
    2. href="../relative/path#id" for a markdown file at ../relative/path.md or ../relative/path/index.md.

Any feedback/pointers are greatly appreciated. I imagine it is not too hard to fix, given that the linter has partial support for it already.

Although my plate is currently full, I welcome any code pointers/green light on how to fix it, and I can take a stab at it at some point in the future.

@OmarTawfik
Copy link
Author

cc @tcort any thoughts about how involving the fix is? I imagine it is a simple change, but probably involves a few different packages.

@MikeMcC399
Copy link

@MikeMcC399

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants