jam*_*mes 5 ckeditor drupal-7 drupal-modules
我有一个使用ckeditor 4.2的Drupal 7站点.我已经创建了一个基本的页面节点,并在一个h2标题中添加了一个span.我在html视图中对其进行了硬编码.它看起来很好,但如果我回去编辑页面,我已经得到了html和任何style =""我已经加入html了.我查看了ckeditor配置和文本格式.我已经设置了唯一允许为text和full html的格式,所以我根本就没有使用过滤.是什么赋予了?我以前多次使用过编辑器,但可能不是这个版本.
The*_*mis 21
如果您正在使用CKeditor模块,那么高级选项中有一个选项,在模块主页中也会提到您应该设置的选项:
config.allowedContent = true;
Run Code Online (Sandbox Code Playgroud)

小智 9
上述解决方案均不适合我.我发现CKEditor正在从HTML中删除空的<span>标记.例如:
<div class="section-heading">
<span class="sep-holder-l"><span class="sep-line"></span></span>
<h4>Section Header</h4>
<span class="sep-holder-r"><span class="sep-line"></span></span>
</div>
Run Code Online (Sandbox Code Playgroud)
会产量:
<div class="section-heading">
<h4>Section Header</h4>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,如果我在最里面的<span>中添加了一个不间断的空格,则CKEditor不会编辑HTML:
<div class="section-heading">
<span class="sep-holder-l"><span class="sep-line"> </span></span>
<h4>Section Header</h4>
<span class="sep-holder-r"><span class="sep-line"> </span></span>
</div>
Run Code Online (Sandbox Code Playgroud)
希望能帮到那里的人!
在 Drupal 7 中,CKEditor 的过滤器(称为高级内容过滤器)和 Drupal 的过滤器之间没有自动同步。据我了解,您配置了后一个,但没有配置第一个。看config.extraAllowedContent。
| 归档时间: |
|
| 查看次数: |
21830 次 |
| 最近记录: |