Drupal 8.2.x文本编辑器将“ div类”删除。 [英] Drupal 8.2.x text editor stripping-removing "div classes"

查看:63
本文介绍了Drupal 8.2.x文本编辑器将“ div类”删除。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Druapl 8.2.1文本编辑器和CKeditor上遇到问题,系统一直在剥离-从

中删除类,例如:

I have a problem with Druapl 8.2.1 text editor and CKeditor, system keeps stripping - removing classes from "

And example of this:

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

系统渲染:

<div>&nbsp;</div>

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

I can't configure the allowed elements, that was only possible in previous versions (config.allowedContent = true;)

任何帮助将不胜感激

推荐答案

好吧,好吧,我在想完之后又重新思考了我已经做的所有事情,我只是做了剩下要做的事情。

Ok, well after breaking my head thinking and re thinking in all I have already done I just did what it was left to do.

因为没有办法修改Drupal版本8.2.x中的allowedContent ...在创建新文本格式和编辑器之前,我做了什么,但是我在允许的HTML中选择了限制允许的HTML标签并纠正错误的HTML选项我所有的标签字段我想接受的课程:

Since there is no way to modify the allowedContent in Drupal version 8.2.x... what I did before it was to create a "New text format and editor" but I had selected the option "Limit allowed HTML tags and correct faulty HTML" and in the allowed HTML tags field I had all the classes I wanted to be accepted:

<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>...

我只是取消选中限制允许的HTML标记并纠正错误的HTML并保持选中已保存并纠正HTML错误选项,并保存!!

I just unchecked the "Limit allowed HTML tags and correct faulty HTML" and keep the "Correct faulty and chopped off HTML" option checked, saved and voila!!

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

Now Drupal keeps all my div classes.

请注意,在选项文本编辑器中我选择了无,如果选择了 CKEditor,则不起作用。

Take into consideration that in the option "Text editor" I had selected "NONE", it do not work if "CKEditor" is selected.

:)

这篇关于Drupal 8.2.x文本编辑器将“ div类”删除。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆