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

Link checker fails on anchor links within other elements #285

Closed
bmorelli25 opened this issue Jan 22, 2025 · 2 comments · Fixed by #349
Closed

Link checker fails on anchor links within other elements #285

bmorelli25 opened this issue Jan 22, 2025 · 2 comments · Fixed by #349
Assignees
Labels

Comments

@bmorelli25
Copy link
Member

Summary

I'm seeing the following error when building the ES Guide:

Error: `es-connectors-s3-usage-create-iam` does not exist in es-connectors-s3.md.
     ┌─[/Users/brandon/Documents/GitHub/elasticsearch.md/docs/es-connectors-s3.md]
     │
 124 │ S3 users will also need to [Create an IAM identity](es-connectors-s3.md#es-connectors-s3-usage-create-iam)
     ·                           ─────────────────────────────────────────────────────                           
     ·                                                                                                            
     │
     └─

This error indicates that:

  1. in the /es-connectors-s3.md file
  2. there is a link to es-connectors-s3.md#es-connectors-s3-usage-create-iam
    I can verify this is correct: Image

However, the link checker fails saying that the anchor does not exist. This is happening because the anchor lives inside of a collapsable block. Note that the anchors do work just fine when clicked on the page:

Image

Steps to repro

  1. dotnet publish "src/docs-builder/docs-builder.csproj" && ./.artifacts/publish/docs-builder/release/docs-builder serve -p ../elasticsearch.md
  2. Visit http://localhost:3000/es-connectors-s3.html#es-connectors-s3-usage-create-iam
@reakaleek
Copy link
Member

reakaleek commented Jan 27, 2025

This could be fixed by #349.

But I think there is the question if we actually want to support this. In the current implementation, this means, that these headers also added to right "On This Page" table of contents.

(I have a feeling the original implementation only considered top level headings on purpose)

Not sure if this is desired.

WDYT?

@Mpdreamz?

@reakaleek
Copy link
Member

As discussed merging it for now. We might revisit this in the future. Follow-up issue: #352

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

Successfully merging a pull request may close this issue.

2 participants