plantuml tinymce v4集成可能吗?

时间:2019-01-09 11:53:10

标签: tinymce tinymce-4 plantuml

我正在尝试将plantuml集成到tinymce v4中。 添加compat3x配置后,我可以加载plantuml/editor_plugin_src.js,但是随后出现错误。

由于plantuml/tinymce的说明似乎适用于v3,因此它使用了旧的advanced主题,我认为该主题与v4不兼容。我已经测试过使用theme : "modern",,但是会产生相同的错误。

根据TinyMCE Advanced theme - Where is it?,v4不使用advanced theme,因此看起来像

theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,justifyfull,separator,numlist,bullist,outdent,indent,separator,forecolor,backcolor,separator,hr,link,unlink,image,code,separator,plantuml",

不可用,可能导致报告错误

Uncaught TypeError: Cannot read property 'add' of undefined
at t.(anonymous function).t.(anonymous function).init (https://myUrl/tinymce/plugins/plantuml/editor_plugin_src.js:29:20)
at Fx (tinymce.min.js:2)
at Array.<anonymous> (tinymce.min.js:2)
at Object.Ht [as each] (tinymce.min.js:2)
at jx (tinymce.min.js:2)
at pw.<anonymous> (tinymce.min.js:2)
at Array.<anonymous> (tinymce.min.js:2)
at Ht (tinymce.min.js:2)
at u (tinymce.min.js:2)
at n (tinymce.min.js:2)

代码错误ed.onNodeChange.add(function(ed, cm, n) {

// Add a node change handler, selects the button in the UI when a image is selected
        ed.onNodeChange.add(function(ed, cm, n) {
            cm.setActive('plantuml', n.nodeName == 'IMG');
        });
    },

有关如何在tinymce v4中使用plantuml的任何建议,将不胜感激。

0 个答案:

没有答案