Drupal 8.2.x 文本编辑器 stripping-removing "div classes"

Drupal 8.2.x text editor stripping-removing "div classes"

我在使用 Druapl 8.2.1 文本编辑器和 CKeditor 时遇到问题,系统不断剥离 - 从“中删除 类

例如:

<div class="social clearfix">&nbsp;</div>

系统呈现:

<div>&nbsp;</div>

我无法配置允许的元素,这只能在以前的版本中实现 (config.allowedContent = true;)

如有任何帮助,我们将不胜感激

好吧,在打破我的头脑思考并重新思考我已经完成的所有事情之后,我只是做了剩下要做的事情。

由于无法在 Drupal 版本 8 中修改 allowedContent。2.x...我之前所做的是创建一个 "New text format and editor" 但我选择了选项 "Limit allowed HTML tags and correct faulty HTML" 并且在允许的 HTML 标签字段中我有所有我想被接受的 类:

<div> <div class> <div id><a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <p> <br> <span>...

我刚刚取消选中 "Limit allowed HTML tags and correct faulty HTML" 并保持选中 "Correct faulty and chopped off HTML" 选项,保存并瞧!!

现在 Drupal 保留了我所有的 div 类。

考虑到我在选项"Text editor"中选择了"NONE",如果选择了"CKEditor"它就不起作用了。

:)