Skip to content

rST: add warning about duplicate anonymous hyperlink targets #13400

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jayaddison
Copy link
Contributor

Purpose

The goal of this pull request is to identify duplicate internal hyperlink targets -- the presence of these can cause documentation hyperlinks to resolve ambiguously (e.g. sometimes incorrectly) at build-time.

References

@AA-Turner AA-Turner added this to the 8.3.0 milestone Mar 1, 2025
@jayaddison
Copy link
Contributor Author

The changes in 4df6239 seem to introduce a large number of false-positive warnings; numbered footnotes, for example, are frequently a source of distraction with this in place. I'll move this pull request back into draft status until I can resolve that problem.

@jayaddison jayaddison marked this pull request as draft March 1, 2025 22:52
…tions

Re-uses some existing filtering for footnotes and other acceptable duplicates.

Some false-positives continue to occur with this change in place; for example,
internal hyperlink targets that are subsequently `include`d into other docs.
@jayaddison
Copy link
Contributor Author

Todo: extend the test coverage to add an example of document that is include'd into more than one other location; this appears to be another case where the same symptom (ambiguous resolution of anonymous hyperlinks) can occur.

Comment on lines +3 to +5
.. _ambiguous_shared_hyperlink:

This hyperlink target is declared once and is included by multiple documents.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AA-Turner @picnixz is there a way to determine a unique declaration identifier/path -- e.g. where a hyperlink was defined, instead of where it is used?

When reporting warnings about duplicated anonymous hyperlinks, it'd be nice to be able to indicate clearly that the duplication originates from multiple includes of a common document, instead of weird/confusing warnings about the hyperlinks appearing in multiple documents.

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.

Possible bug: duplicate rST hyperlink targets don't appear to emit a warning during project processing?
2 participants