How to allow particular CSS classes for particular HTML tags in post editor?


(Anton) #1

I’d like to allow text wrapping around images.

For this, I’d make a special CSS class.

Is there a way to allow only selected CSS classes for particular HTML tags in the post body? Currently, it strips any classes if I add them manually.

For example, in editor:

<img src="/uploads/default/original/2X/f/fd7886de9a5629779b3cfd0fad83c5a4b8c81633.png" width="180" height="130" class="wrap-left">

Generated HTML:

<img src="//forum.kozovod.com/uploads/default/original/2X/f/fd7886de9a5629779b3cfd0fad83c5a4b8c81633.png" width="180" height="130">

So, the class wrap-left is removed.

P.S. We desperately need more advanced editor to make our key posts look better and reflect blog articles.


(Régis Hanol) #2

The only way I can think of right now is building a plugin to whitelist that CSS class for the “img” tag.