Ckeditor4: Editor Placeholder plugin throws an error during editor initialization when used with bbcode and fullpage

Created on 3 Sep 2020  路  3Comments  路  Source: ckeditor/ckeditor4

Type of report

Bug

Provide detailed reproduction steps (if any)

See https://github.com/ckeditor/ckeditor4/pull/4251#pullrequestreview-481525255.

  1. Open any empty editor instance with bbcode plugin and fullPage: true configuration set.

Expected result

Editor initializes and works correctly.

Actual result

Error is thrown (same as in #4249).

Other details

Can be tested on https://codepen.io/f1ames/pen/oNLQvNe.

  • Browser: -
  • OS: -
  • CKEditor version: 4.15.0
  • Installed CKEditor plugins: editorplaceholder,bbcode
good first issue bbcode editorplaceholder S confirmed bug

All 3 comments

I don't use the bbcode plugin but I have the same issue because I have a filter that removes the body tag when getData() is called. Basically my input is a full page but my output is not. It may not be a common use case but I think it's valid. The editorplaceholder needs to bulletproof a bit this line where the error is thrown:

data = data.match( fullPageRegex )[ 1 ];

It makes the wrong assumption that getData() always returns the body tag when full page is on.

For future reference - if you add bbcode plugin using config.extraPlugins, you'll get an error. If you just add it to the explicit plugin list with config.plugins, like in our dev sample, everything works fine.

Was this page helpful?
0 / 5 - 0 ratings