I'm trying to revive Astro CB's auto edit corrections script. I've got a lot of it updated, improved, and working with Stack Exchange changes since 2015.
One thing that stuck on is setting the markdown from the new StackApps WYSIWYG editor that is currently used for answers on the meta sites. I can find the element in the page and gets its markdown with jQuery:
However, I haven't figured out how to set the markdown back into the editor after modifying it. I have found the following that looks promising:
But when I run it I get:
I've also tried using
I found another user script that wraps something like that in
using, but I get the same result with:
How do I get access to the StacksEditor from a user script so that I can set the markdown after editing it automatically?