简体   繁体   English

Drupal-CKEditor的config.js在哪里?

[英]Drupal - Where is located config.js of CKEditor?

I am trying to find the configuration file of CKEditor (v8.5.3) so I can remove automatical stripping of classes from div element using config.extraAllowedContent = 'div(*)'; 我试图找到CKEditor(v8.5.3)的配置文件,所以我可以使用config.extraAllowedContent = 'div(*)';从div元素中删除自动剥离的类config.extraAllowedContent = 'div(*)';

I have found some threads where are people referencing the config.js in the root file of CKEditor but I cant find it in there. 我在CKEditor的根文件中找到了一些引用config.js的线程,但是我在那儿找不到它。 Any idea where I can found this configuration file? 知道在哪里可以找到此配置文件吗? Thank you for response. 感谢您的回应。

I've ran a file search from the command line, and can confirm that nowhere does the file config.js exist (using v8.6.x). 我从命令行运行了文件搜索,可以确认文件config.js不存在(使用v8.6.x)。

I found another case of an admin losing classes on DIVs in CKEditor (though in version 8.2.x), and the only way she found to remedy that, was to create a new text format at /admin/config/content/formats . 我发现另一种情况是管理员在CKEditor中丢失了DIV上的类(尽管在8.2.x版中),而她发现要解决这一问题的唯一方法是在/ admin / config / content / formats中创建新的文本格式 Then, including 然后,包括 in allowed HTML tags: 在允许的HTML标签中:

<div class>

Her full solution can be found here . 她的完整解决方案可以在这里找到。 It includes some pointers as to which options to select when creating the new text format. 它包括一些有关创建新文本格式时要选择哪些选项的指针。

I'm not a Drupal guy but from what I have checked, in D8 you can set the configuration using hook_editor_js_settings_alter . 我不是Drupal的人,但根据我的检查,在D8中,您可以使用hook_editor_js_settings_alter进行配置。 Please see: 请参见:

When it comes to filtering HTML however you should, in your Drupal Admin Panel, go to Configuration -> Content Authoring (Text formats and editors) . 但是,当涉及到过滤HTML时,您应该在Drupal管理面板中转到Configuration -> Content Authoring (Text formats and editors) There you can either configure "Allowed HTML tags" or simply uncheck "Limit allowed HTML tags and correct faulty HTML" checkbox what will allow everything. 您可以在此处配置“允许的HTML标记”,也可以简单地取消选中“限制允许的HTML标记并更正错误的HTML”复选框,以允许所有操作。

If you wish to configure your HTML here is IMO a nice link showing the filter syntax: https://www.drupal.org/node/2571349 如果您想配置HTML,请单击IMO,这是一个不错的链接,其中显示了过滤器语法: https : //www.drupal.org/node/2571349

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM