解決百度編輯器ueditor插入視頻網址保存不了問題


問題:如下圖,在百度編輯器中插入視頻,視頻網址可以識別,但是提交內容后視頻卻顯示不了。

解決:這個問題主要是編輯器中會過濾一些html標簽,所以可以給標簽添加白名單。

修改 ueditor.config.js 文件:

修改:

img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', '_url', 'loadingclass', 'class', 'data-latex'],

在白名單后面添加:

source: ['src', 'type'],
embed:  ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style', 'wmode', 'play', 'autoplay', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen', 'controls', 'preload'],
iframe: ['src', 'class', 'height', 'width', 'max-width', 'max-height', 'align', 'frameborder', 'allowfullscreen']
 
        

修改后如下所示:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM