You've already forked joplin
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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user