Jump to content

Allow some tricky css on CMS content


Recommended Posts

Hi,

 

I encountered a problem when editing a CMS content. I wanted to center an image. In the source code, I had 

<p><img style="margin-left: auto; margin-right: auto; display: block;" src="http://localhost/mywebsite/img/cms/test.jpg" alt="Imprimantes" width="848" height="566" /></p>

but after saving the content the display: block; disappeared so the image was not centered in the content.

 

After investigation, i noticed that the library HTMLPurifier was removing the display: block;. OK I can disable the HTML Purifier in the configuration but this kind of thing is legitimate in HTML so I would propose to disable this kind of filtering by allowing tricky CSS.

 

In Tools::purifyHTML(...), it could be interesting to add 

$config->set('CSS.AllowTricky', true);

so the code can be purified and display: block; will not disappear anymore.

 

Is there any Prestashop developer who can validate this suggestion? and maybe implement it in a next version of Prestashop?

Edited by titchagcreation (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...