[英]How to define custom html tags in ckeditor
How can I define custom html tags in ckeditor. 如何在ckeditor中定义自定义html标签。
The above thing is working. 上面的东西正在工作。 But when I execute the below code the output is null in case of custom html tag like profile tag. 但是,当我执行以下代码时,对于自定义html标签(如配置文件标签),输出为null。
var current_selected_element = editor.getSelection().getSelectedElement(); var current_selected_element = editor.getSelection()。getSelectedElement(); console.log(current_selected_element); 的console.log(current_selected_element);
The problem is that CKeditor's advanced content filter is filtering out your custom tags ... you're going to have to configure the ACF to accept the custom tags your plugin is creating and inserting into the DOM. 问题在于CKeditor的高级内容过滤器正在过滤您的自定义标签...您将必须配置ACF以接受您的插件正在创建并插入DOM的自定义标签。 There are a couple ways this can be done. 有两种方法可以完成此操作。 The most basic would be to implement config.extraAllowedContent = 'profile'
or whatever the name of your custom markup will be. 最基本的方法是实现config.extraAllowedContent = 'profile'
或自定义标记的名称。 Otherwise you can work with the global CKEditor.filter
object. 否则,您可以使用全局CKEditor.filter
对象。 There's more documentation on the CKEDITOR.filter
object here . 这里有关于CKEDITOR.filter
对象的更多文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.