-
Notifications
You must be signed in to change notification settings - Fork 18k
x/website: code and other elements no longer display in TOC #69816
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
Comments
CL 601055 made the change to start using One of the ways to fix this is to go back to using text, but arrange for setAnchors to run after generateTOC, not the other way around as it currently happens:
Another approach might be to leave their current running order as is, but modify generateTOC to take into account it ran after setAnchors and not include the '¶' symbol in a different way, one that doesn't cut off text content beyond the first child element. |
Change https://go.dev/cl/618635 mentions this issue: |
CL 618635 changes the order to be:
![]() |
Change https://go.dev/cl/619015 mentions this issue: |
By now, the /js/godocs.js and /js/playground.js scripts are already loaded on all go.dev pages because they're included at the bottom of the root site.tmpl template. The layout template for blog pages also loads those scripts. That means /js/godocs.js runs twice, and that causes duplicate anchor links to be added to article headings. Remove the duplicate scripts, keeping only play.js which isn't already present in site.html. Update it to reuse the existing window.initFuncs mechanism. For golang/go#68596. For golang/go#69816. Change-Id: I709f4b8df30500bddbbf16f4ddd95f266f290472 Reviewed-on: https://go-review.googlesource.com/c/website/+/619015 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Go version
tip
Output of
go env
in your module/workspace:What did you do?
Looked at https://go.dev/doc/faq.
What did you see happen?
See, for example, https://go.dev/doc/faq. The TOC has several incomplete entries, such as "Why is" and "Why does Go not have the". These are because the headers in _content/doc/faq.md uses header lines like
and
In https://go.dev/cl/601055 for #68596 the TOC code was changed to only display the first element. That is causing the truncation we see here.
CC @hyangah @dmitshur
What did you expect to see?
Untruncated TOC lines.
The text was updated successfully, but these errors were encountered: