[Solved] Redactor Isn't Obeying Allowedtags Param Via Cm-Wysiwyg Loader

So im trying to allow script and style tags in Redactor. Apparently CS uses the older version 1, and according to docs and source there is an allowedTags parameter that should do the trick.

So, CS has its own editor loading mechanism(s) found in /js/tygh/editors/editorname.editor.js. Its able to piggyback in parameters from this script, which seems pretty straightforward.

Lets add the allowedTags like so:

this.params.allowedTags = ['script', 'style'];

Seems like that should be cool right? However it's not working. Any ideas whats up with this? It said its a depreciated function, but CS is running the old version, so it should be good to go.

Notes about that here:

https://imperavi.com/redactor/docs/upgrading-to-redactor-ii/

I see there is a rando site that claims:

Either use the Allowed Tags setting, or the Denied Tags setting - not both! When using the Allowed Tags setting, you can whitelist accepted tags in the content - others will be stripped.

Does this mean in a parameter sense? DeniedTags is defined in source, but allowedTags are not. In a sane world, you could init allowedTags param (and not deniedTags) to bypass this logic...but it seems buggy. Or the cm-wysiwyg init is throwing it off.

Your solution works on my local installation. Your code was added under the following line:

this.params.replaceDivs = false;

(!) Do not forget to clear cache (system, not templates one)

Your solution works on my local installation. Your code was added under the following line:

this.params.replaceDivs = false;

(!) Do not forget to clear cache (system, not templates one)

Ahh the &cc helped indeed (even though this is a cache-off test store, swear i tried that, thanks). I also see why now its not acting quite right and what that whitelist quote actually meant: in src lib its a boolish false and deniedTags is on by default. So my example snippet only allowed scripts, styles, P and perhaps span. In the redactor src allowedTags is set to false by default, so rather than a init side param adding into an array, its switching off other filtering systems like verifiedTags, inlineTags, alignmentTags, blockLevelElements, and other handlers when init'd allowedTags becomes "full of something", or true.

So more or less, until they update to newer Redactor 2, or short of editing src, think of every element you need and go from there:

this.params.allowedTags = ['a', 'img', 'b', 'strong', 'sub', 'sup', 'i', 'em', 'u', 'small', 'strike', 'del', 'cite', 'ul', 'ol', 'li', 'strong', 'b', 'u', 'em', 'i', 'code', 'del', 'ins', 'samp', 'kbd', 'sup', 'sub', 'mark', 'var', 'cite', 'small', 'span', 'script', 'noscript', 'meta', 'style', 'P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',  'DL', 'DT', 'DD', 'DIV', 'TD', 'BLOCKQUOTE', 'OUTPUT', 'FIGCAPTION', 'ADDRESS', 'SECTION', 'HEADER', 'FOOTER', 'ASIDE', 'ARTICLE', 'PRE', 'UL', 'OL', 'LI'];

Ahh the &cc helped indeed (even though this is a cache-off test store, swear i tried that, thanks). I also see why now its not acting quite right and what that whitelist quote actually meant: in src lib its a boolish false and deniedTags is on by default. So my example snippet only allowed scripts, styles, P and perhaps span. In the redactor src allowedTags is set to false by default, so rather than a init side param adding into an array, its switching off other filtering systems like verifiedTags, inlineTags, alignmentTags, blockLevelElements, and other handlers when init'd allowedTags becomes "full of something", or true.

So more or less, until they update to newer Redactor 2, or short of editing src, think of every element you need and go from there:

this.params.allowedTags = ['a', 'img', 'b', 'strong', 'sub', 'sup', 'i', 'em', 'u', 'small', 'strike', 'del', 'cite', 'ul', 'ol', 'li', 'strong', 'b', 'u', 'em', 'i', 'code', 'del', 'ins', 'samp', 'kbd', 'sup', 'sub', 'mark', 'var', 'cite', 'small', 'span', 'script', 'noscript', 'meta', 'style', 'P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',  'DL', 'DT', 'DD', 'DIV', 'TD', 'BLOCKQUOTE', 'OUTPUT', 'FIGCAPTION', 'ADDRESS', 'SECTION', 'HEADER', 'FOOTER', 'ASIDE', 'ARTICLE', 'PRE', 'UL', 'OL', 'LI'];

Thank you for the information.