You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question is how to accept <style></style>. I tried adding it in the config/purify but to no avail.
'HTML.Allowed' => 'style,div,b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]',
The text was updated successfully, but these errors were encountered:
Hi @kikz4life, this is entirely an HTMLPurifier question since all my package is, is a wrapper allowing easy access and configuration.
This will be tricky, since it's actually invalid HTML for style tags to be inside of a web pages <body> and not in the <head>, so HTMLPurifier doesn't even allow for these to be inserted, since it could be exploited in various ways that it cannot protect against (disclaimer).
You'll actually need to extract any styles and insert them back into the content that the user has submitted. Here's the walk-through example from their documentation:
Hi,
first of all thank you very much for this.
My question is how to accept <style></style>. I tried adding it in the config/purify but to no avail.
'HTML.Allowed' => 'style,div,b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]',
The text was updated successfully, but these errors were encountered: