因为我们的编辑器过滤是白名单的,所以video目前不自持。后面规则我们也在调整。
目前内容过滤的函数是 clean函数,你自己找一下控制器中对内容进行过滤的地方,把这个函数去掉即可。
已经添加HTML.Allowed中的video[width|height|alt|src|style|class],但是还是不行
return [
'encoding' => 'UTF-8',
'finalize' => true,
'cachePath' => storage_path('app/purifier'),
'settings' => [
'default' => [
'HTML.Doctype' => 'XHTML 1.0 Transitional',
'HTML.Allowed' => 'div,b,font[color|style],strong,i,em,pre,a[href|title|target],ul,ol,li,p[style],br,span[style],img[width|height|alt|src|style|class],table[class|width],td,tr,blockquote,h1,h2,h3,h4,h4,h5,video[width|height|alt|src|style|class]',
'CSS.AllowedProperties' => 'font,font-size,width,height,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
'Attr.AllowedFrameTargets' =>'_blank',
'AutoFormat.AutoParagraph' => true,
'AutoFormat.RemoveEmpty' => true,
],
'test' => [
'Attr.EnableID' => true
],
"youtube" => [
"HTML.SafeIframe" => 'true',
"URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%",
],
],
];