Skip to content
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

Anchor links inside collapsed sections do not work #112

Closed
HighCommander4 opened this issue Sep 27, 2024 · 1 comment
Closed

Anchor links inside collapsed sections do not work #112

HighCommander4 opened this issue Sep 27, 2024 · 1 comment

Comments

@HighCommander4
Copy link
Contributor

Steps to reproduce

Navigate to https://clangd.llvm.org/installation#neovim-built-in-lsp-client (without the page being open already).

Expected results

The section titled "Neovim built-in LSP client" is scrolled into view.

Actual results

Nothing is scrolled into view, presumably because the section in question is under "Vim/Neovim" <details> element, which is in the collapsed state on page load.

Motivation

Users frequently have questions about how to do common tasks (e.g. getting logs) with a particular client, and it helps to be able to link directly to instructions for that client.

@HighCommander4
Copy link
Contributor Author

According to the HTML specification, a <details> element should be expanded if the user navigates to an anchor inside it. (This was specified in a 2021 change to spec: whatwg/html#6466.)

Firefox, which is what I was testing this with, just implemented this specification change: https://bugzilla.mozilla.org/show_bug.cgi?id=1724299. Chrome appears to have already implemented it at the time of filing this issue.

I verified that I get the "Expected results" with both Chrome, and with the nightly version of Firefox. No change to the website is required.

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

No branches or pull requests

1 participant