CDATA code added is added to javascripts and styles


By default tinymce when you use <script> tag or <style> tag changes the code a little. Rich text editor from tinyMCE wraps the script/styles code with special html markup CDATA. It was added many years ago to tinymce to avoid problems with scripts usage in browser. How to remove the CDATA from tinymce?

Firstly you need to make sure that your shop uses module in version - at least v2.3.4. Module for PrestaShop in this version implements modified rich text editor where the script and style code is no longer wrapped with CDATA.

 

But there is one additional thing required to change in PrestaShop settings. It's a "html purifier". Html purifier is a prestashop's feature that is active by defualt. It cleans up the html code and ... it wraps <style> and <script> code with CDATA html markup. You can find it under preferences > general. As i show on the screenshot: 

Html purifier in prestashop

 

Just make sure that this option is not active. After this you will be able to save your script and styles, and both tinymce editor and prestashop html purifier will not wrap code with CDATA anymore.