【发布时间】:2011-05-26 17:27:08
【问题描述】:
如何在 HtmlPurifier 中允许自定义(html5 data-*)属性?
输入:
<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')
【问题讨论】:
-
如果您需要改进您的问题,请随时进行编辑。如果您有答案......请随时发布
标签: html custom-attributes htmlpurifier