Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-7260

Anchor links in markdown broken when not on the default branch

    XMLWordPrintable

Details

    Description

      When an anchor link is used in a markdown file, it will only work on the default (usually master) branch. This looks to be likely caused by the ?at=refs%2Fheads%2Fbranch-name that's appended to the end of the URL.

      Steps to reproduce

      1. Create a new branch.
      2. Create a new markdown document that includes a named anchor <a name="TOC"></a> and a link to that anchor [contents](#TOC).
      3. Push the new branch to Stash.
      4. Open the repository's Source page in Stash.
      5. Switch to displaying the new branch.
      6. Open the markdown document.
      7. Click on the link and nothing happens, but it should jump to the anchor location.

      The link used is http://stash.company.com/projects/PROJ/repos/repo/browse/test.md?at=refs%2Fheads%2Ftest-branch#TOC?at=refs%2Fheads%2Ftest-branch.

      Expected Result

      The URL that is generated should be something along the lines of http://stash.company.com/projects/PROJ/repos/repo/browse/test.md?at=refs%2Fheads%2Ftest-branch#TOC and scroll to the appropriate location.

      Attachments

        Issue Links

          Activity

            People

              sgoodhew Scott Goodhew (Inactive)
              jethomas Jeff Thomas
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: