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