Drupal - CKEditor config.js 位于何处?
Drupal - Where is located config.js of CKEditor?
我正在尝试查找 CKEditor (v8.5.3) 的配置文件,以便我可以使用 config.extraAllowedContent = 'div(*)';
从 div 元素中删除 类 的自动剥离
我发现了一些线程,人们在其中引用了 CKEditor 根文件中的 config.js,但我在那里找不到它。知道在哪里可以找到这个配置文件吗?
感谢您的回复。
我从命令行运行 搜索了一个文件,可以确认文件 config.js 不存在(使用 v8.6.x)。
我发现另一个管理员在 CKEditor 的 DIV 上丢失 类 的案例(尽管在版本 8.2.x 中),她发现补救的唯一方法是创建一个新的/admin/config/content/formats 处的文本格式。然后,在允许的 HTML 标签中包含 :
<div class>
可以找到她的完整解决方案 。它包括一些关于创建新文本格式时 select 选项的指示。
我不是 Drupal 专家,但根据我的检查,在 D8 中您可以使用 hook_editor_js_settings_alter
设置配置。请看:
- https://api.drupal.org/api/drupal/core%21modules%21editor%21editor.api.php/function/hook_editor_js_settings_alter/8.5.x
- https://drupal.stackexchange.com/questions/186102/drupal-8-ckeditor-behaves-ltr-in-an-rtl-site/186303#186303
在过滤 HTML 时,您应该在 Drupal 管理面板中转到 Configuration -> Content Authoring (Text formats and editors)
。您可以在那里配置 "Allowed HTML tags" 或简单地取消选中 "Limit allowed HTML tags and correct faulty HTML" 复选框,这将允许一切。
如果你想配置你的 HTML 这里是 IMO 一个很好的 link 显示过滤器语法:https://www.drupal.org/node/2571349
我正在尝试查找 CKEditor (v8.5.3) 的配置文件,以便我可以使用 config.extraAllowedContent = 'div(*)';
我发现了一些线程,人们在其中引用了 CKEditor 根文件中的 config.js,但我在那里找不到它。知道在哪里可以找到这个配置文件吗? 感谢您的回复。
我从命令行运行 搜索了一个文件,可以确认文件 config.js 不存在(使用 v8.6.x)。
我发现另一个管理员在 CKEditor 的 DIV 上丢失 类 的案例(尽管在版本 8.2.x 中),她发现补救的唯一方法是创建一个新的/admin/config/content/formats 处的文本格式。然后,在允许的 HTML 标签中包含 :
<div class>
可以找到她的完整解决方案
我不是 Drupal 专家,但根据我的检查,在 D8 中您可以使用 hook_editor_js_settings_alter
设置配置。请看:
- https://api.drupal.org/api/drupal/core%21modules%21editor%21editor.api.php/function/hook_editor_js_settings_alter/8.5.x
- https://drupal.stackexchange.com/questions/186102/drupal-8-ckeditor-behaves-ltr-in-an-rtl-site/186303#186303
在过滤 HTML 时,您应该在 Drupal 管理面板中转到 Configuration -> Content Authoring (Text formats and editors)
。您可以在那里配置 "Allowed HTML tags" 或简单地取消选中 "Limit allowed HTML tags and correct faulty HTML" 复选框,这将允许一切。
如果你想配置你的 HTML 这里是 IMO 一个很好的 link 显示过滤器语法:https://www.drupal.org/node/2571349