Drupal 8.2.x文本编辑器剥离-" div classes&" [英] Drupal 8.2.x text editor stripping-removing "div classes"

查看:71
本文介绍了Drupal 8.2.x文本编辑器剥离-" div classes&"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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文本编辑器剥离-&quot; div classes&amp;&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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