Skip to content

Clicking headline #anchor on already anchor-linked page adds another #anchor #4246

Description

@ewerybody

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

  1. goto https://gitbook.com/docs/getting-started/quickstart#getting-started
  2. click the # in front of the Getting started headline
  3. copy URL from adress bar
  4. paste in new tab, Enter
  5. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions