Try dialogs.share_text(editor.get_text()), I think that does what you're looking for. (It shares the text as if you pressed "Share..." on a text selection, rather than sharing the file.)
Oops! Looks like something went wrong!
You may only upload PNG, JPG, or GIF files ()