带有类Attribute

时间:2018-07-11 23:32:37

标签: ckeditor

报告类型

错误

这是我的配置。

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.language = 'en';
config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML';
config.mathJaxClass = 'my-math';
config.extraPlugins = ['htmlcomments','htmlcitations','mathjax'];   
//https://stackoverflow.com/questions/15659390/ckeditor-automatically-strips-classes-from-div
config.allowedContent = true;
config.stylesSet = 'my_styles';
config.removePlugins = ['a11ychecker','balloonpanel','div','divarea','texzilla','format','contents','balloontoolbar','autosave','letterspacing','newpage','codesnippet','toc','stylesheetparser','mathedit','footnotes','crossreference','codeTag','mathedit'];
config.extraAllowedContent = '*{*}(*)';
};

如果我插入editor.insertHtml('<span data-cool="foo">new tet</span>');之类的内容,则效果很好。但是,如果我添加@class属性,例如editor.insertHtml('<span class="foo">new tet</span>');,则会出现以下错误。即使插入MathJax公式,也会出现相同的错误。

ckeditor.js:2036 Uncaught TypeError: f is not a function
at D (ckeditor.js:2036)
at ckeditor.js:2036
at Array.forEach (<anonymous>)
at C (ckeditor.js:2036)
at L._onPaste (ckeditor.js:2067)
at a.n (ckeditor.js:10)
at a.<anonymous> (ckeditor.js:12)
at a.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)
at a.insertHtml (ckeditor.js:286)
at <anonymous>:1:14
D @ ckeditor.js:2036
(anonymous) @ ckeditor.js:2036
C @ ckeditor.js:2036
_onPaste @ ckeditor.js:2067
n @ ckeditor.js:10
(anonymous) @ ckeditor.js:12
CKEDITOR.editor.CKEDITOR.editor.fire @ ckeditor.js:13
insertHtml @ ckeditor.js:286
(anonymous) @ VM3736:1

预期结果

<span class="foo">new tet</span>

实际结果

以上步骤的实际结果是什么?

其他详细信息

  • 浏览器:Chrome
  • 操作系统:Macintosh
  • CKEditor版本:4

0 个答案:

没有答案