As you probably already know, Redactor removes any inline styling.
replaceDivs doesn't appear to be in later versions of Redactor (at the least, it's not documented.)
Redactor will always remove Script tags, per the documentation. (I ran into this issue a few days ago.) Redactor supposedly has an option for this, but it doesn't appear to work in Craft, and has shaky documentation.
Here's the official Redactor documentation for it:
Using this setting with false argument, you can restrict use of script tag in your HTML. Redactor will automatically and always strip this tag form the code.
Here's the actual setting for Redactor:
I was able to get Redactor to allow script tags by removing that functionality from Redactor's core, but this should be considered a very temporary workaround until we can get someone from P&T to add it, or clarification on the tag's proper use:
- Go to
craft/app/resources/lib/redactor/redactor.js on line 193, and remove the 'script' tag from the array.
- Comment out line 1980
- Comment out line 2049
- Comment out line 8006
Again, this is very temporary until someone from P&T can confirm proper tag functionality. You're modifying core, which is almost never a good thing.