This is kind of related to my last question. But made a new topic since it’s a new question.
What is the best way to modify the preview (that you see when composing a post) with javascript in a theme component?
I know I can modify the DOM (after it’s cooked) in decorateCookedElement, but would be nice to have something like addPostTransformCallback where you can modify the cooked post as a string (with t.cooked). But addPostTransformCallback doesn’t get called when the preview is updated (only when you first open to edit a post).
I’m interested in updating both the preview and the submitted post (but don’t want to save the modifications ).
Worried that if I make my modifications to the DOM (with decorateCookedElement) it will be too slow. Although I need to make some tests to see if that’s really the case.