1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Plugins: expose hash from clicked cross-note link (#12094)

This commit is contained in:
Dan Serbyn
2025-04-14 14:42:24 +02:00
committed by GitHub
parent cb3c9b4607
commit bd49f3b280

View File

@@ -197,4 +197,14 @@ export default class JoplinWorkspace {
return this.store.getState().selectedNoteIds.slice();
}
/**
* Gets the last hash (note section ID) from cross-note link targeting specific section.
* New hash is available after `onNoteSelectionChange()` is triggered.
* Example of cross-note link where `hello-world` is a hash: [Other Note Title](:/9bc9a5cb83f04554bf3fd3e41b4bb415#hello-world).
* Method returns empty value when a note was navigated with method other than cross-note link containing valid hash.
*/
public async selectedNoteHash(): Promise<string> {
return this.store.getState().selectedNoteHash;
}
}