gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 05:01:59 26 4
gpt4 key购买 nike

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

这个例子:

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

系统呈现:

<div>&nbsp;</div>

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

任何帮助将不胜感激

最佳答案

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

由于无法修改 Drupal 8.2.x 版中的允许内容...我之前所做的是创建“新文本格式和编辑器”,但我选择了选项“限制允许的 HTML 标签并更正错误的 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>...

我刚刚取消选中“限制允许的 HTML 标记并更正错误的 HTML”,并保持选中“更正错误并切断 HTML”选项,保存并瞧瞧!!

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

考虑到在“文本编辑器”选项中我选择了“无”,如果选择了“CKEditor”则它不起作用。

:)

关于html - Drupal 8.2.x 文本编辑器 stripping-removing "div classes",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40050090/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com