Can Anchors Link Within A Single Note?

Operating system

Windows 11

Joplin version

3.0.14

Desktop version info

Joplin 3.0.14 (prod, win32)

Client ID: 19ab120bd04f48f39427c13bc1c4ae2e
Sync Version: 3
Profile Version: 47
Keychain Supported: Yes

Revision: 05cf51e

Advanced Tagging Rules: 1.4.0
Backup: 1.4.1
Conflict Resolution: 1.2.3
Copy Anchor Link: 1.1.0
Insert Date: 1.0.1
Menu items, Shortcuts, Toolbar icons: 1.1.0
Note Link System: 0.8.0
Quick Links: 1.3.2
Quick Move: 1.1.0
Random note: 1.0.3
Repeating To-Dos: 0.10.3
Reset Checkboxes: 1.0.3
Search & Replace: 2.2.0
Slash Commands: Datetime & More: 1.3.2
Templates: 2.4.0
Text Colorize: 1.2.5

Editor

Markdown Editor

What issue do you have?

I've seen several posts about linking to headings on other notes with anchors, but is there a way to link to different spots in the same note? I tried using a link from the Copy Anchor plugin, but was still only able to jump to headings if they were in a note that was different from the one that had the link in it.

Yes. If you give an element an ID, say foo (using HTML, I don’t think there’s a way in markdown), you can link to it by making the link's URL #foo.

Example:

<span id="foo">Anchor</span>

[Link to anchor](#foo)
<a href="#foo">Link 2</a>
2 Likes

Awesome, thank you! Looks like I'm going to need to start learning HTML so that I can do more stuff, I didn't even know this was possible.

You can use “Copy Anchor Link” plugin to get the link that used within the same note. The type of link that you’re looking for is LI or LH which are hidden by default. It looks something like this [Welcome to Joplin!](#welcome-to-joplin). To enable it you can check the information on github.

This method works for me.

But note that it's not necessary to create span IDs manually. If you use headers (H1, H2, H3, etc.), Joplin automatically creates an internal anchor for each. If you have a header for "Chapter Three", then its internal anchor is "#Chapter_Three". From experimenting, the anchor text is case insensitive and the delimiter char can be a hyphen or underscore, for example "#chapter_three" or "#chapter-three". You could link to it with [Chapter Three](#chapter_three).

2 Likes

Oh, I didn't realize that those had to be enabled. Thank you!

Updating my post above. The anchor text is case-insensitive but the delimiter char must be a hyphen.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.