Page 1 of 1

I can't centered image in KB-article

Posted: Sun Sep 20, 2020 4:59 pm
by Stan_1
Hi!

I use a hesk3. I'm insert a image in KB-article, and make it centered. I see on editor screen, that image was centered. In css-style (if switch to html) I see additional styles on image: style="margin-left: auto; margin-right: auto; display: block;"

But after save, the image align by left. The styles where cleared. :(

How do I prevent clearing text alignment styles?

Best,
Stan

Re: I can't centered image in KB-article

Posted: Sun Sep 20, 2020 7:02 pm
by Klemen
It's disallowed by default in the third party HTML sanitation library Hesk uses.

You can allow it like this:

1. open file /inc/htmlpurifier/HeskHTMLPurifier.php in a code editor (like Notepad++)
2. find

Code: Select all

$purifier = new HTMLPurifier($config)
3. just ABOVE that add

Code: Select all

$config->set('CSS.AllowTricky', true);
4. save, upload and test

Re: I can't centered image in KB-article

Posted: Sun Sep 20, 2020 8:09 pm
by Stan_1
Klemen wrote: Sun Sep 20, 2020 7:02 pm 4. save, upload and test
Yes! It's work. Thank you! :)