CKEDITOR初始化过程中删除HTML5视频块

问题描述 投票:0回答:1

我有视频DIV CONTENTEDITABLE后初始化CKEditor的视频消失。

我试图ckeditor4和ckeditor5内嵌11.2.0中的所有脚本在我的本地服务器,而不是CDN。火狐浏览器Chrome的ANF

<div id="editor" contenteditable="true">
    <p>Lorem ipsum ...</p>
    <video src="[realy correct path to video]" controls></video>
</div>
<script>
    ClassicEditor.create( document.querySelector( '#editor' ) );
</script>

其结果是,我得到这样的:

<div id="editor" contenteditable="true">
    <p>Lorem ipsum ...</p>   
</div>
javascript ckeditor html5-video contenteditable
1个回答
1
投票

请注意,在CKEditor的5总的原则是,如果没有它处理特定HTML元素,类,样式或属性,HTML“东西”将被编辑器过滤掉一个插件。不像CKEditor的4,allowedContent选项不存在,因为你不能使更多的HTML“东西”比当前加载的插件处理什么。这是最有可能的,为什么视频标签已丢失的理由。

另请参阅:https://ckeditor.com/docs/ckeditor5/latest/builds/guides/faq.html#why-does-the-editor-filter-out-my-content-styles-classes-elements-where-is-configallowedcontent-true

© www.soinside.com 2019 - 2024. All rights reserved.