我将我的ckeditor从4.7.3更新到了最新的4.14.1,没有任何问题。但是当我尝试使用paste from word插件时,我得到了这个错误:Uncaught TypeError: Cannot read property 'styles' of undefined in the pastefromword/filter/default.js
错误出现在default.js文件的最开始处:
( function() {
'use strict';
var tools = CKEDITOR.tools,
pastetools = CKEDITOR.plugins.pastetools,
commonFilter = pastetools.filters.common,
Style = commonFilter.styles, // <-- error this line
createAttributeStack = commonFilter.createAttributeStack,
getElementIndentation = commonFilter.lists.getElementIndentation,
...不知道为什么,我有pastetools插件,但似乎过滤器被设置为{},所以commonFilter最终变成了undefined,导致了我的错误。插件不能在没有过滤器的情况下工作吗?我不知道过滤器是如何工作的。
我在想一个配置问题。我在构建配置中添加了'pastefromword' : 1, 'pastetools' : 1。“从word粘贴”按钮在我的工具栏中,但我无法从word粘贴。
PS:我没有定制的版本,为了更新,我在ckeditor的网站donwload page上下载了完整的包
发布于 2020-12-29 20:50:11
我遇到了同样的问题,我修复了它包括粘贴插件。
ckeditor/plugins/pastetools/filter/common.js
https://stackoverflow.com/questions/63260510
复制相似问题