【问题标题】:angular ckeditor extra plugins giving error角度ckeditor额外插件给出错误
【发布时间】:2017-03-05 03:43:02
【问题描述】:

我正在尝试使用以下角度 ckeditor 扩展 -

https://github.com/lemonde/angular-ckeditor

更新: 已经在应用模块中注入了 'ckeditor'

我将以下指令插入到我的部分 html -

<div ckeditor="data_options" ng-model="note.note_data" ready="onReady()"></div>

并向控制器添加以下配置选项 -

$scope.data_options = {
            lang: 'en',
            allowedContent: true,
            entities: false,
            extraPlugins: ['mathjax'],
            mathJaxClass: 'm-equation',
            mathJaxLib: 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-AMS_HTML'
        };

但我在浏览器中收到以下错误 -

Uncaught TypeError: d.replace is not a functionA @ ckeditor.js:249(anonymous function) @ ckeditor.js:248(anonymous function) @ ckeditor.js:475(anonymous function) @ ckeditor.js:236e @ ckeditor.js:231A @ ckeditor.js:231r @ ckeditor.js:231(anonymous function) @ ckeditor.js:232

我是否犯了任何其他错误,或者这可能是一个错误或什么? 是否有任何替代方法来获得支持 mathjax(tex/latex) 的 Angular wysiwyg 编辑器

【问题讨论】:

  • 您是否将“ckeditor”注入到模块依赖项中?
  • 是的。它可以在没有额外插件、mathjaxlib、类配置选项的情况下工作
  • 未来注意事项:cdn.mathjax.org 即将结束生命周期,请查看mathjax.org/cdn-shutting-down 了解迁移提示。
  • 未来注意事项:cdn.mathjax.org 即将结束生命周期,请查看mathjax.org/cdn-shutting-down 了解迁移提示。

标签: javascript angularjs ckeditor wysiwyg mathjax


【解决方案1】:

extraPlugins 必须是字符串,而不是数组,如下所示:

$scope.data_options = {
            lang: 'en',
            allowedContent: true,
            entities: false,
            extraPlugins: 'mathjax',
            mathJaxClass: 'm-equation',
            mathJaxLib: 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config=TeX-AMS_HTML'
        };

要使用多个额外的插件,您只需使用逗号分隔:

extraPlugins: 'plugin1,plugin2,plugin2'

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-07-23
  • 1970-01-01
  • 2016-03-25
  • 2017-10-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-04
相关资源
最近更新 更多