Welcome! » Log In » Create A New Profile

CSS properties top and bottom.

Posted by Zachary Rosenthal 
Zachary Rosenthal
CSS properties top and bottom.
March 20, 2017 03:57PM

Hello, I am using Katex to allow users to enter mathematical formulas into my website forum. Katex uses css properties top and bottom to help display the formulas. I have noticed that HTMLPurifier strips these out.

<p style="top: 50px">Hello World!</p>

results in

<p>Hello World!</p>

while something like

<p style="color: red">Hello World!</p>

displays perfectly. (you can check both of these on the sites demo page)

I have two questions

1) Why are the top and bottom css properties stripped out?

2) How can I go about allowing them?

Thank you!

Re: CSS properties top and bottom.
March 20, 2017 04:09PM

By default, we don't enable absolute position elements, because they can be used to phish trusted UI elements on the page. They can be enabled with %CSS.Trusted but be careful!

Zachary Rosenthal
Re: CSS properties top and bottom.
March 20, 2017 04:14PM

Thank you for the quick response!

Is it possible to only enable a few of the css properties?

Re: CSS properties top and bottom.
March 20, 2017 04:19PM

Not really sorry. %CSS.AllowedProperties might help.

Sorry, you do not have permission to post/reply in this forum.