How to call plugin command by clicking a rendered link?

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

I don't think it's possible at the moment, and the ipcProxySendToHost function is an internal one used for specific commands. I guess there should be a function that post a message back to the plugin, and from there you could send commands or do any other action.

All right, thanks for your reply. Indeed would be great if such function was there - it would allow to make at least slightly more interactive contents.