Purifier
Purifier copied to clipboard
data attribute issue
how to allow data-attribute for hyperlink?
thanks
This. Updating 'custom_attributes' => [] delivers nothing.
This is working for me for example to allow a data-media-id attribute for images:
- Add data attribute to allowed section:
'HTML.Allowed' => 'img[width|height|alt|src|class|data-media-id]'
- Specify the data attribute in the custom_attributes section:
'custom_attributes' => [
['img', 'data-media-id', 'Text']
]