Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: Insert As Relative Link Doesn't Preserve Heading Anchors # #2656

@seaspeak

Description

@seaspeak

Describe the bug
When using the Insert As Relative Link command, the link to a specific heading (the part after the # symbol) is incorrectly removed. This results in the pasted link only pointing to the file, not the specific section within it, which breaks the intended functionality of an in-file link.

To Reproduce
Steps to reproduce the behavior:

  1. Create a note with at least one heading (e.g., # My Heading).
  2. Right-click on the heading and select the "Copy Link Address" option.
  3. Go to edit mode
  4. Right-click and choose "Paste" and "Insert As Relative Link."
  5. Observe the resulting link.

Expected behavior
The pasted link should be a relative link that includes the heading anchor.

For example, if the original link was FileName#My-Heading, the pasted link should remain [My Heading](FileName#My-Heading) to correctly point to the heading.

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 3.19.2

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions