Is there a way to get codeblock content at cursor?

Hi there!

I’m trying to make a command to execute a codeblock, but I’m finding it really hard to get the codeblock content.

Other plugins I found (obsidian-wielder, obsidian-execute-code) seem to work by querying for all code elements in a reader view, then running code automatically or adding buttons to code blocks. I wanted mine to work in the editor view instead, closer to a REPL experience.

Cheers,
Filipe