You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CKEditor集成WIRIS插件点击后无公式编辑内容显示问题咨询

配置冲突修正

首先修正你当前配置中存在的两处明显冲突:

  1. 工具栏重复定义了WIRIS按钮项,需删除冗余声明:
var toolbar = [
    {name: 'wiris', items: ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_formulaEditorChemistry']},
    // 移除下面重复的wiris配置行
    // {name: 'wiris', items: ['Wiris']},
];
  1. extraPlugins和removePlugins存在冲突项,移除重复的uploadimage声明:
var ckConfig = {
    // 删掉extraPlugins里的uploadimage,该插件已在下方removePlugins中声明移除
    extraPlugins: "image2,mathjax,justify,ckeditor_wiris",
    mathJaxLib: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML',
    allowedContent: true,
    extraAllowedContent: mathElements.join(' ') + '(*)[*]{*};img[data-mathml,data-custom-editor,role](Wirisformula)',
    removePlugins: 'image,filetools,uploadimage,uploadwidget,uploadfile,filebrowser',
};

路径加载校验

打开浏览器开发者工具的「网络」面板,点击WIRIS图标后筛选以下资源的加载状态:

  • 检查WIRIS插件的plugin.js是否正常加载:路径为你配置的ns.basePath + '/ckeditor/plugins/wiris/plugin.js',若返回404则修正路径配置
  • 检查MathJax依赖库是否正常加载,无403、404、超时等异常

Cookie策略调整

你截图中的报错为Chrome浏览器的SameSite Cookie拦截问题,WIRIS公式编辑器通过独立iframe弹出,会被浏览器默认拦截未适配SameSite规则的Cookie:

  • 调整站点Cookie的SameSite属性为Lax,若站点为HTTPS环境也可设置为None并开启Secure属性
  • 若站点配置了内容安全策略(CSP),需添加frame-src 'self'规则放行同站点iframe加载

服务状态校验

若你使用自部署的WIRIS后端服务,检查服务是否正常启动,相关接口请求无500、跨域等异常。

内容的提问来源于stack exchange,提问作者behnam rahimpour

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.06 16:54:04