ezyang / htmlpurifier

Standards compliant HTML filter written in PHP
http://htmlpurifier.org
GNU Lesser General Public License v2.1
3.07k stars 327 forks source link

Element 'button' is not supported (for information on implementing this, see the support forums #358

Open Krishna-najpk opened 1 year ago

Krishna-najpk commented 1 year ago

Hi,

I am getting this error while adding button tag in html code. - "Element 'button' is not supported (for information on implementing this, see the support forums"

I want to add button tag like this. <button type="button" onclick="alert('Hello world!')">Click Me!</button>

Here is my config.

'HTML_Allowed' => 'div,b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src],iframe[src|width|height|class|frameborder],blockquote, *[style|class],button[type]', 'CSS_AllowedProperties' => 'font, font-size, font-weight, font-style, font-family, text-decoration, padding-left, color, background-color, text-align ', 'URI_SafeIframeRegexp' => '%^(https?:)?//(www.linkedin.com/embed/|www.youtube.com/embed/|player.vimeo.com/video/)%'

ezyang commented 1 year ago

check out http://htmlpurifier.org/docs/enduser-customize.html