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

fix(internal/godocfx): use correct anchor links #3738

Merged
merged 2 commits into from Feb 25, 2021
Merged

Conversation

tbpg
Copy link
Contributor

@tbpg tbpg commented Feb 25, 2021

This works by pre-processing the package and generating all of the correct anchor links. Then, when converting an ID to a link, we check if the ID is listed in the map of anchors.

It's possible there will be some duplication between IDs. But, that is already an issue because there is no way to know which one is correct to link to. An alternative would be to set the anchor for any duplicated links to "" so they don't link at all. In practice, I don't think this is an issue. So, I left it as-is and we can revisit later if needed.

Fixes #3737.

@tbpg tbpg requested a review from codyoss February 25, 2021 16:43
@tbpg tbpg requested a review from a team as a code owner February 25, 2021 16:43
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 25, 2021
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tbpg tbpg added the automerge Merge the pull request once unit tests and other checks pass. label Feb 25, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 919039a into master Feb 25, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the godocfx branch February 25, 2021 17:38
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

godocfx: page-local anchor links broken
2 participants