11
如何在HtmlPurifier中允许自定义(html5 data- *)属性?htmlpurifier自定义属性
输入:
<img src="/my.jpg" data-type="5" alt="" />
导致一个错误:
Attribute 'data-type' in element 'img' not supported
(for information on implementing this, see the support forums)
HtmlPurifier选项被设置为:
'HTML.AllowedAttributes' => array('img.src', 'a.href', 'img.data-type')
如果你需要改进你的问题,随时编辑它。如果您有答案,请随时发布 – 2010-12-16 22:16:31