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 duplicate implicit references with the same id #175

Closed
wants to merge 1 commit into from

Conversation

wouterj
Copy link
Collaborator

@wouterj wouterj commented Jan 9, 2022

This fixes a common bug in the docs (it has been reported multiple times over the past couple weeks).

If two or more titles on the same page have the same name, the references to the sections is wrong (as the ID is duplicate, you can never link to the second section).

Sphinx/docutils solve this by replacing any duplicate internal references with id1, id2, etc. I suggest making things a bit nicer by adding -1, -2, ... to the actual reference ID instead.

For reference, docutils actually manages references using a node visitor pattern. We've discussed adding something like this before (#145), but with the ongoing development on PHPdocumentor's side, I'm trying to keep the changes to this library to a minimal.

@wouterj wouterj marked this pull request as draft January 9, 2022 17:58
@wouterj
Copy link
Collaborator Author

wouterj commented Jan 9, 2022

Converting to draft: I realized some parts of this library still rely on simply calling Environment::slugify() to get a reference to a title.

@linawolf
Copy link
Collaborator

linawolf commented Jan 6, 2023

@wouterj might this be fixed by #232?

@greg0ire greg0ire removed their request for review June 22, 2023 20:44
@wouterj wouterj closed this Sep 30, 2023
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

Successfully merging this pull request may close these issues.

3 participants