I know that I can get the selected text from a note
//Get selected text
const selectedText = (await joplin.commands.execute('selectedText') as string);
//Get active note
const note = await joplin.workspace.selectedNote();
but then how can I edit the text? Should I edit it and then assign new note text to note body like
note.body = editedText;
?
UPDATE: I guess I should use sth like
joplin.data.put(['notes', joplin.workspace.selectedNoteIds[0]], null, { body: editedText });