javascript - CKEditor:如何在文本部分粘贴 url 时删除自动嵌入行为(4.7 版)
问题描述
我正在使用 CKEditor 4.7 版。
在 config.js 文件中,我集成了一些用于在外部网站(例如 youtube、twitter、facebook 等)上自动嵌入链接的插件。
CKEDITOR.editorConfig = function( config ) {
config.extra_plugins = 'widgetselection,notificationaggregator,notification,clipboard,lineutils,widget,dialogui,dialog,embedbase,embed';
};
但是,对于某些页面,当我在 ckeditor 的文本部分复制 url 时,我看到了自动嵌入行为。我需要禁用它,如果只有当我单击选项卡上的特定图标时才会有这种行为会更好。只有当我单击该图标而不是当我简单地将链接 url 粘贴到 CKEditor 时,才会出现嵌入 iframe 的方法?
解决方案
好的,我找到了解决方案,每个组件都有属性 removePlugins 执行此操作,在这种情况下,我删除了 embedbase 和 embed 插件,如下所示:
CKEDITOR.replace('text1', {
allowedContent : true,
autoParagraph: false,
removePlugins: 'embedbase, embed',
toolbar : [ ['Source'], ['Bold','Italic','Underline'], [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ], [ 'Styles', 'Format' ], ]});
推荐阅读
- javascript - Fixed top row in table and unintended resize
- reactjs - 使用 Material-UI 进行酶浅测试
- c# - 为什么 ExecuteNonQuery 会返回“输入在此上下文中无效”(ASP.NET | Ole Db)?
- android - 包含嵌套 RecyclerViews 的 BottomSheetBehavior ViewGroup 的垂直滚动不一致
- javascript - 如何保持文字的比例?
- angular - agm-marker-cluster 中的图像路径格式是什么,如何为不同类型分配不同的标记簇图标?
- exchangewebservices - Route exchange online public folder hierarchy requests failed with "Expected an item Id but received a folder Id"
- r - R如果一列中的值再次出现在另一列中而没有循环,则删除行
- bash - 如何使用 bash 将 if then 语句添加到具有多个参数的值
- spring - How to build a nonblocking Consumer when using AsyncRabbitTemplate with Request/Reply Pattern