ckeditor 条带 <span>和样式属性 [英] ckeditor strips <span> and style attributes

查看:23
本文介绍了ckeditor 条带 <span>和样式属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 ckeditor 4.2 的 Drupal 7 站点.我创建了一个基本的页面节点,并在正文的 h2 标题内放置了一个跨度.我在 html 视图中对其进行了硬编码.它看起来不错,但如果我回去编辑页面,我的 html 以及任何 style="" 我都已放入 html 中.我查看了 ckeditor 配置和文本格式.我已经设置了允许的唯一格式是文本和完整的 html,所以我根本不使用过滤.是什么赋予了?我以前用过很多次编辑器,但可能不是这个版本.

I have a Drupal 7 site using ckeditor 4.2. I've created a basic page node and put a span inside an h2 heading in the body. I hard coded it in the html view. It looks fine but if I go back to edit the page, my has gotten stipped out of the html and also any style="" I've put into the html also. I've looked at the ckeditor config and text-formats. I've set the only formats allowed to be text and full html so I'm not using filtered at all. What gives? I've used the editor many times before but probably not this version.

推荐答案

如果你使用的是 CKeditor模块,那么高级选项中有一个选项,模块主页中也提到了,您应该在其中设置:

If you are using the CKeditor module then there is an option in Advanced Options that is also mentioned in the module homepage where you should set:

config.allowedContent = true;

这篇关于ckeditor 条带 <span>和样式属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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