I can't centered image in KB-article

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Stan_1
Posts: 5
Joined: Sun Sep 20, 2020 4:52 pm

I can't centered image in KB-article

Post 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
Klemen
Site Admin
Posts: 10142
Joined: Fri Feb 11, 2005 4:04 pm

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

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Stan_1
Posts: 5
Joined: Sun Sep 20, 2020 4:52 pm

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

Post by Stan_1 »

Klemen wrote: Sun Sep 20, 2020 7:02 pm 4. save, upload and test
Yes! It's work. Thank you! :)
Post Reply