Clicking headline #anchor on already anchor-linked page adds another #anchor
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 29k
- Forks
- 4k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 71
Description
Bug description
When visiting a gitbook-page with an anchor link like:
https://gitbook.com/docs/getting-started/quickstart#getting-started
Clicking again on a headline # adds to the existing url instead of replacing it. Invalidating linking to any of the anchors:
https://gitbook.com/docs/getting-started/quickstart#getting-started#getting-started
How to reproduce
- goto https://gitbook.com/docs/getting-started/quickstart#getting-started
- click the
#in front of the Getting started headline - copy URL from adress bar
- paste in new tab, Enter
- Page is at the very top, not at desired title
expected:
Clicking # replaces any existing #anchor in the URL, keeping it's functionality intact.
Additional context
Tested in
- Firefox 151.0b7 (64-bit) and
- Chrome 147.0.7727.139 (Official Build) (64-bit)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Reproduce the URL-fragment behavior in Firefox or Chrome, then trace the frontend handling for the # link on the “Getting started” headline. Done means clicking it replaces the existing fragment with a single anchor and reopening the URL lands at the heading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100