-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Linkchecker croaks on specific anchors of GitHub-rendered reStructuredText documents #9016
Comments
If my understanding is correct, the behavior of anchors in GH came from JavaScript works. There is no anchors without "user-content" prefix in the HTML output. So it's difficult to check the anchor. Do you remember what version have you used before the update? I'd like to try to reproduce why the old version can handle it correctly. |
Hi Takeshi, thank you for your quick response. I will try to answer your question thoroughly but please bear with me that I might not know every detail. So, as far as I am involved, I know that we are currently upgrading from Sphinx 1 to Sphinx 3. We can see from crate/crate-docs@1650a50, that we probably used Sphinx 1.7.4 beforehand. However, I am currently not sure if something might have changed on GitHub's reStructuredText rendering. So, taking that moving target into account, maybe Sphinx isn't even responsible at all for seeing our CI croaking on this detail now. The upgrading to Sphinx 3, which revealed this, might just have been a coincidence.
Exactly.
I already also thought about whether some JavaScript served by GitHub might be involved to make those anchors (here:
Absolutely. I also believe that there might be nothing we can do about it. Nevertheless, I wanted to share this story as a reference point for others. Maybe it can also serve as an anchor [sic!] to point this out to the GitHub developers, to check if they had some recent changes on their content rendering engine and whether they might be keen on rethinking the respective updates. With kind regards, |
Hi Takeshi, apparently, anchors with "user-content" prefix are already around for quite some time, as the references at github/markup#425, https://github.com/MicrosoftDocs/azure-devops-docs/issues/6015, go-gitea/gitea#11896 and go-gitea/gitea#12062 are outlining. There even seem to be recipes like [1,2] and software solutions like [3,4] which show a way how to apply workarounds for that dilemma. While I still don't know why this hasn't tripped the linkchecker before on our end, as the implementation coming from e0e9d2a7 seems to be around since Sphinx 1.2 already, I quickly wanted to share those observations and findings with you. With kind regards, [1] https://gist.github.com/borekb/f83e48479aceaafa43108e021600f7e3 |
I tried to check the anchors with Sphinx-1.7.4. And it also fails as the newest one does.
I created a sphinx project via sphinx-quickstart command and modified
I still don't understand why the linkcheck was succeeded before the update... |
Hi Takeshi, thanks for taking the time to look into this. The most probable reason why that didn't croak before is probably that we might have turned warnings into errors by using the So, I believe it is totally fine to close this issue. However, if you feel we could improve the Sphinx linkchecker on this matter, I will be happy to submit a patch which takes that topic into account by adding the Given that users would still like to use the short anchor variant (like With kind regards, |
I have some contradictory opinions for this:
|
… anchors of github.com
Close #9016: linkcheck builder failed to check the anchors of github.com
Dear Takeshi, thank you very much for #9260. With kind regards, |
Dear Sphinx developers,
first things first: Thanks a stack for your paramount work on Sphinx. You already saved many souls of people writing technical documentation and probably also beyond this audience.
We just observed a minor woe with Sphinx' linkchecker we wanted to share with you. We really like that the linkchecker is able to check anchors within HTML documents as contributed by @intgr on behalf of #842.
With kind regards,
Andreas.
Describe the bug
We had the link [1] in our documentation, and, maybe after upgrading to more recent versions of Sphinx, the linkchecker suddenly started croaking on that. After changing it to [2], it worked again. When inspecting the source code of the respective HTML page, you can clearly see that the anchor name
#user-content-make-changes
defined byis technically correct. However, it apparently has worked before by referencing
#make-changes
. So, we are wondering if something changed on GitHub's reStructuredText renderer or even Browsers interpreting the HTML link anchors differently. When invoking those links [1,2] in the Browser, actually both work, including navigation to the appropriate place within the page. Funny, hm?[1] https://github.com/crate/crate-docs-theme/blob/master/DEVELOP.rst#make-changes
[2] https://github.com/crate/crate-docs-theme/blob/master/DEVELOP.rst#user-content-make-changes
Expected behavior
Technically, from the perspective we know our way around HTML, the behavior is probably the right thing and correct.
However, as we can see, something might have been changed on the HTML standard that Browsers are capable of interpreting different styles of defining link anchors. So, it might be worth to revisit this space and maybe improve the linkchecker implementation on those aspects.
Environment info
The text was updated successfully, but these errors were encountered: