I am using htmlpurifier to clean up user content. I am trying to remove inline style attributes like
<div style="float:left">some text</div>
I want to remove the whole style attribute.
How to do it using htmlpurifier?
I am using htmlpurifier to clean up user content. I am trying to remove inline style attributes like
<div style="float:left">some text</div>
I want to remove the whole style attribute.
How to do it using htmlpurifier?
You can tweak the AllowedProperties configuration by passing it an array of valid css attributes that should not be removed (white-list approach).
However, the following should remove all css attributes
See this online demo of purifying your input html