[singlehtml] toctree no filename with anchor #13717
Open
+7
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Fix toctree links to page anchor in the singlehtml output.
Only matters for themes that include the right sidebar in the singlehtml page, but particularly useful for using the singlehtml to then generate a pdf (since the toctree allows fine tuning the depth of the table of contents).
On #11970, same-document links dropped the uri (filename part). On #12551, fixes to do not include the filename on hyperlinks was added. So an anchor for a:
#document-my-page
#my-anchor
.On #13037, fix_refuris was removed, which would blindly rmatch #.*
However, #12551 missed the toctree constructor, which was still generating:
#document-my-page#my-anchor
Modify _resolve_toctree() to do not include rel_uri if the is an anchorname.
Tests failing
These two tests are failing, from the immediate previous commit:
It may be necessary to make the code specific to when the builder is singlehtml.
References