I would like to execute a plugin action after user clicks a link generated by a custom renderer in markdown.
What I tried:
joplin.plugins.register({
onStart: async function () {
// ....
await joplin.commands.register({
name: 'moveCard',
label: 'Move card from current column to specified',
execute: async (args: any[]) => {
alert('Move card: ' + args.join());
},
});
},
});
and in the renderer code I generate a <a> link with onclick defined like this:
<a onclick="ipcProxySendToHost(\'moveCard\')>click me</a>"
I also tried postMessage() and window.joplinPostMessage_() but none of them worked at all. With ipcProxySendToHost() I get an error that moveCard command is not found.
I would appreciate any advice how to do it correctly