2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 111 forks source link

Markdown plugin error #123

Closed mogilka closed 5 years ago

mogilka commented 6 years ago

Hello, I'm trying to use CKEditor with some plugins downloaded from https://ckeditor.com/cke4/addon section:

$this->registerJs("CKEDITOR.plugins.addExternal('markdown', '/js/markdown/', 'plugin.js');"); $this->registerJs("CKEDITOR.plugins.addExternal('emojione', '/js/emojione/', 'plugin.js');");

<?=$form->field($model, 'text')->widget(CKEditor::className(), [ 'options'=>['rows'=>6], 'preset'=>'custom', 'clientOptions'=>[ 'extraPlugins'=>'emojione,markdown', 'toolbarGroups'=>[ ['name'=>'undo'], ['name' => 'links', 'groups' => ['links', 'insert']], ['name' => 'others', 'groups' => ['others', 'about']], ['name' => 'emojione'] ] ] ])?>

emojione works perfect, but markdown does not: when I press Markdown button in toolbar, text area become empty and an error occured (see details below). Would you fix it please?

ckeditor.js:88 Uncaught DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('cke_source cke_reset cke_enable_context_menu') contains HTML space characters, which are not valid in tokens. at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.element.CKEDITOR.tools.extend.addClass (http://telega.local/assets/b332a96/ckeditor.js:88:69) at Object.markdown (http://telega.local/js/markdown/plugin.js?t=H8DC:49:26) at a.CKEDITOR.editor.setMode (http://telega.local/assets/b332a96/ckeditor.js:331:466) at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.command.exec (http://telega.local/js/markdown/plugin.js?t=H8DC:189:24) at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.command.exec (http://telega.local/assets/b332a96/ckeditor.js:192:379) at a.execCommand (http://telega.local/assets/b332a96/ckeditor.js:260:171) at CKEDITOR.ui.button.CKEDITOR.tools.extend.click (http://telega.local/assets/b332a96/ckeditor.js:631:164) at Object.execute (http://telega.local/assets/b332a96/ckeditor.js:632:269) at http://telega.local/assets/b332a96/ckeditor.js:633:146 at http://telega.local/assets/b332a96/ckeditor.js:30:218

tonydspaniard commented 5 years ago

That seems an issue with the ckeditor.js and the markdown plugin itself not from the widget. Let me know if the problem was other. Thanks.