nextcloud / nextcloud/text

Anchor links do not bring you to the relevent heading

Open
#8,724 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: links
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

Describe the bug

In the text editor, when you hover over a heading (H1, H2, H3, etc), it offers a little hashtag icon to the left of it with a link to that anchor point in the document. For example (the #h-2026-06-09 bit in the URL below):

https://mycloud.example.com/apps/files/files/162509?dir=/todo/2026&editing=false&openfile=true#h-2026-06-09

However, opening this link does not take you to that heading. It appears that the anchor is dropped from the URL during the process of loading the document.

To Reproduce
Steps to reproduce the behavior:

  1. Create a text file (markdown) with a heading.
  2. Copy the link to the heading with the appropriate hashtag appended to the URL.
  3. Visit that link in another browser tab.
  4. Observe that you are not taken to the heading, and the hashtag is dropped from the URL.

Expected behavior

I would expect that visiting that link would take me to the appropriate position in the document.

Server details:

  • Nextcloud version: 32
  • PHP Version: (using official Docker image)
  • Database: PostgreSQL 14

Client details:

  • OS: Debian
  • Browser: Firefox
  • Browser version: 128.4.0esr (64-bit)
  • Device: desktop

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the text editor's heading-anchor and document-loading flow, then reproduce the issue with a Markdown heading and a copied hashtag link. Trace where the URL is processed when the document opens; done means the hash remains in the URL and the browser navigates to the matching heading.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, markdown
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.