I've been working on a branch for Redactor to parse different blocks in different ways.
It makes a button and you can pick a style, and it puts it in.
Initially I just had it wrap code in <pre><code></code></pre> but then I tried to introduce highlight.js for good WYSIWYG.
Unfortunately redactor has some stuff going in the background that just munges it each time.
You can see what I am doing here:
I think the smarter way is if I introduce post parsing as they load in instead of trying to do it in the composer box on the fly.
Is it possible for me to hook into each post and run code against it?
Essentially I'd have the post saved in the db with the plain <pre> tag, but when it loaded into the DOM I'd either (serverside or clientside, whichever) parse the post and run any <pre> blocks through highlight.js to get them looking right.
Is that possible? Anybody able to point me in the right direction?