Outline heading anchors are removed from file URLs on open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Describe the bug
When right-clicking and copying a heading anchor or outline link, and trying to use that (either in another note, or email, chat, etc.), the link opens the file, but does not go to the specific Outline heading. Noted the link does include the "#heading" within the URL, but that "#heading" is dropped when the page opens.
To Reproduce
Steps to reproduce the behavior:
- Create a New text file (as Note.md)
- Insert a heading: Ctrl+Shift+5
- Type enough text to make the page scroll of screen
- Insert another heading heading: Ctrl+Shift+5
- Open the link in the
#anchor in a new tab or window - See the fragment being removed from the url
https://github.com/user-attachments/assets/e7e3b630-8579-49d5-bce2-6a2b6b85d334
Expected behavior
Pasted link should open the text file, and scroll to the Outline link header. Instead, the file just opens to default view.
Client details:
- OS: Windows and Fedora
- Browser: Firefox and Chrome
- Version: 10 and 36
- Device: Desktop
Server details
Text app version: 3.6.0
Operating system: CentOS Stream 8
Web server: Apache
Database: MariaDB Galera Cluster
PHP version: 8.1
Nextcloud version: originally reported in text for 25.04 - still happening in 31.0.6
Logs
Nextcloud log (data/nextcloud.log)
Nothing relevant is logged
Browser log
Nothing relevant is logged. However, it should be noted that the #heading is dropped from the URL once the page loads.
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
Reproduce the anchor-link behavior in the Text app using the provided steps, then inspect the browser URL as the file opens. No file or test is named in the issue; done means opening a copied #heading link preserves the fragment and navigates to the corresponding outline heading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100