Closed 06tech closed 1 year ago
Image tags are having their style attributes removed - the style tags are added by an RTE so I have no control over how the markup is generated.
Example is:- <img src="..." style="width: 50%;"> -> <img src="...">
<img src="..." style="width: 50%;">
<img src="...">
My config is as follows:-
HTML.Allowed' => 'h1,h2,h3,h4,h5,h6,b,strong,i[class|id],em,a[href|title|class|id|style],ul,ol,li,p[style|class],br,span[style|class|id],img[width|height|alt|src|class|style],div[style|class|id]',
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,padding-right,padding-top,padding-bottom,padding,color,background-color,text-align,background,width,height',
I thought it could be the config cache so I ran:-
php artisan purify:clear but that produced the error There are no commands defined in the "purify" namespace.
php artisan purify:clear
There are no commands defined in the "purify" namespace.
Any ideas? Thanks
Hi @06tech!
Please create an issue on the core HTML Purifier repository, as Purify simply wraps this library:
https://github.com/ezyang/htmlpurifier
Image tags are having their style attributes removed - the style tags are added by an RTE so I have no control over how the markup is generated.
Example is:-
<img src="..." style="width: 50%;">
-><img src="...">
My config is as follows:-
HTML.Allowed' => 'h1,h2,h3,h4,h5,h6,b,strong,i[class|id],em,a[href|title|class|id|style],ul,ol,li,p[style|class],br,span[style|class|id],img[width|height|alt|src|class|style],div[style|class|id]',
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,padding-right,padding-top,padding-bottom,padding,color,background-color,text-align,background,width,height',
I thought it could be the config cache so I ran:-
php artisan purify:clear
but that produced the errorThere are no commands defined in the "purify" namespace.
Any ideas? Thanks