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

url filter gives the wrong path to local anchor links #1655

jessitron opened this Issue Oct 12, 2018 · 1 comment


None yet
2 participants
Copy link

jessitron commented Oct 12, 2018

When passed "#internal-anchor" on a page other than the top-level index, the url filter returns a relative path to the top-level index.

Like, if I have a page and the page.url is about/; if I pass "#internal-anchor" to the url filter, I get ../#internal-anchor.

The url filter should not modify those URLs that are internal to the current page.

(I suffer from this problem when using the material theme; in 3.0.4, in the "Skip to content" link, it passes a toc item's url to the url filter, which breaks it on every page except the top-level index. HTMLProofer complains about the broken link.)


This comment has been minimized.

Copy link

waylan commented Oct 13, 2018

Thanks for the report.

This has gone unnoticed because the builtin themes did not pass TOC URLs through the url filter. As all TOC URLs have only ever been for the current page, there was no need to do so. However, with #1594 the readthedocs theme now offers the option to include the TOC for all pages in the nav. Therefore, this could be a problem for that theme as well.

waylan added a commit to waylan/mkdocs that referenced this issue Oct 13, 2018

@waylan waylan closed this in #1656 Oct 13, 2018

waylan added a commit that referenced this issue Oct 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment