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')