|
|
@@ -214,7 +214,12 @@ export default class DecoupledEditor extends Editor {
|
|
|
*/
|
|
|
static create( sourceElementOrData, config = {} ) {
|
|
|
return new Promise( resolve => {
|
|
|
- Editor._assertAllowedSourceElement( sourceElementOrData );
|
|
|
+ const isHTMLElement = isElement( sourceElementOrData );
|
|
|
+
|
|
|
+ if ( isHTMLElement && sourceElementOrData.tagName === 'TEXTAREA' ) {
|
|
|
+ // Documented in core/editor/editor.js
|
|
|
+ throw new CKEditorError( 'editor-wrong-element: This type of editor cannot be initialized inside <textarea> element.' );
|
|
|
+ }
|
|
|
|
|
|
const editor = new this( sourceElementOrData, config );
|
|
|
|
|
|
@@ -224,7 +229,7 @@ export default class DecoupledEditor extends Editor {
|
|
|
editor.ui.init();
|
|
|
} )
|
|
|
.then( () => {
|
|
|
- if ( !isElement( sourceElementOrData ) && config.initialData ) {
|
|
|
+ if ( !isHTMLElement && config.initialData ) {
|
|
|
// Documented in core/editor/editorconfig.jdoc.
|
|
|
throw new CKEditorError(
|
|
|
'editor-create-initial-data: ' +
|