I am working on a workflow for using Docverter to convert markdown, latex, and HTML into the same three formats. The workflow uses Editorial 1.1's new custom UI feature to allow the user to set Docverter options before clicking a button. Output from Docverter will, depending on the button tapped, either be copied to the clipboard or inserted in the editor.
Right now, for debugging purposes, I'm using a simple string as the input for sending to Docverter, but eventually want the workflow to get the input text using editor.get_text().
I'm having (so far) two problems that I can't diagnose, one (I think) Editorial-related and one python-related.
The Editorial one: often, after the workflow successfully runs, when I try to run the workflow again, I get a spinning wheel in where the wrench icon was, and the custom UI never again appears. I have to force quit the app. Occasionally, I can run the workflow successfully two or three times before the spinning wheel appears. But more frequently, I am only able to run it once before I have to force quit whenever I try it again. I don't think it's a Docverter problem, because the API call is in a function that is never called unless a button on the Custom UI is clicked.
The Python problem is a familiar one, but one that always gives me fits: encoding. If I change my diagnostic input string ("Hello world!" in the Gist) to one that has special characters like "smart quotes" and "smart apostrophers" and "em-dashes," then Docverter returns an error. I think this is because Docverter needs unicode, but I can't figure out the right sequence of encode/decode commands (or where to place them) to get things to work with special strings.
Any help would be most welcome!