-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom attributes not working #2
Comments
Did you define those attributes in your config file? Not only do you have to enable them in the Example: 'custom_attributes' => [
['a', 'target', 'Enum#_blank,_self,_target,_top'],
['img', 'style', 'Text'],
['img', 'data-filename', 'Text'],
], |
ok, thanks, I'll try it right now. Perhaps I missed them, but are there are any docs/examples to explain usage? I just saw the simple example at the bottom of the README.md. |
I tried setting the
Here is a gist of my config file: |
I got same problem. |
@jplew @pastuh Try playing around with this code: https://github.com/LukeTowers/Purifier/blob/master/src/Purifier.php#L160 and see if you can get HTMLPurifier to accept any hardcoded custom attributes. |
Sorry, but im new in Laravel.. I dont know what to edit. I just tested default custom_attribute: |
Hi:
I'm trying to pass
<img data-filename="...">
and getting this error:Here is the relevant part of my
config/purifier.php
:In addition, I'm trying to pass a 'style' attribute on my
<img>
tag. Despite the fact I have also specified 'style' in myHTML.Allowed
, theclean()
function is stripping out my style attribute. It doesn't give an error message like it does for data-filename, however.Am I doing something wrong?
The text was updated successfully, but these errors were encountered: