How to use the @ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor function in @ckeditor/ckeditor5-engine

To help you get started, we’ve selected a few @ckeditor/ckeditor5-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckeditor / ckeditor5-core / tests / editor / utils / attachtoform.js View on Github external
form = document.createElement( 'form' );
		textarea = document.createElement( 'textarea' );
		form.appendChild( textarea );
		document.body.appendChild( form );
		submitStub = sinon.stub( form, 'submit' );

		// Prevents page realods in Firefox ;|
		form.addEventListener( 'submit', evt => {
			evt.preventDefault();
		} );

		class CustomEditor extends Editor {}
		mix( CustomEditor, ElementApiMixin );

		editor = new CustomEditor();
		editor.data.processor = new HtmlDataProcessor();
		editor.model.document.createRoot();
		editor.model.schema.extend( '$text', { allowIn: '$root' } );
		editor.fire( 'ready' );

		editor.data.set( 'foo bar' );
	} );
github ckeditor / ckeditor5-core / tests / _utils / classictesteditor.js View on Github external
constructor( sourceElementOrData, config ) {
		super( config );

		if ( isElement( sourceElementOrData ) ) {
			this.sourceElement = sourceElementOrData;
		}

		// Use the HTML data processor in this editor.
		this.data.processor = new HtmlDataProcessor();

		// Create the ("main") root element of the model tree.
		this.model.document.createRoot();

		this.ui = new ClassicTestEditorUI( this, new BoxedEditorUIView( this.locale ) );

		// Expose properties normally exposed by the ClassicEditorUI.
		this.ui.view.editable = new InlineEditableUIView( this.ui.view.locale, this.editing.view );
	}
github ckeditor / ckeditor5-core / tests / _utils / virtualtesteditor.js View on Github external
constructor( config ) {
		super( config );

		// Use the HTML data processor in this editor.
		this.data.processor = new HtmlDataProcessor();

		// Create the ("main") root element of the model tree.
		this.model.document.createRoot();
	}
github ckeditor / ckeditor5-core / tests / _utils / modeltesteditor.js View on Github external
constructor( config ) {
		super( config );

		// Use the HTML data processor in this editor.
		this.data.processor = new HtmlDataProcessor();

		// Disable editing pipeline.
		this.editing.destroy();

		// Create the ("main") root element of the model tree.
		this.model.document.createRoot();
	}
github ckeditor / ckeditor5-core / tests / editor / utils / dataapimixin.js View on Github external
beforeEach( () => {
		class CustomEditor extends Editor {}
		mix( CustomEditor, DataApiMixin );

		editor = new CustomEditor();
		editor.data.processor = new HtmlDataProcessor();
		editor.model.document.createRoot( '$root', 'main' );
		editor.model.document.createRoot( '$root', 'secondRoot' );
		editor.model.schema.extend( '$text', { allowIn: '$root' } );
	} );
github ckeditor / ckeditor5-core / tests / editor / utils / elementapimixin.js View on Github external
beforeEach( () => {
		class CustomEditor extends Editor {}
		mix( CustomEditor, ElementApiMixin );

		editor = new CustomEditor();
		editor.data.processor = new HtmlDataProcessor();
		editor.model.document.createRoot();
		editor.model.schema.extend( '$text', { allowIn: '$root' } );
	} );
github ckeditor / ckeditor5-core / tests / editor / standardeditor.js View on Github external
.then( newEditor => {
					editor = newEditor;

					editor.data.processor = new HtmlDataProcessor();

					editor.model.schema.allow( { name: '$text', inside: '$root' } );
				} );
		} );
github ckeditor / ckeditor5-core / tests / editor / utils / elementapimixin.js View on Github external
beforeEach( () => {
		class CustomEditor extends Editor {}
		mix( CustomEditor, ElementApiMixin );

		editor = new CustomEditor();
		editor.data.processor = new HtmlDataProcessor();
		editor.model.document.createRoot();
		editor.model.schema.extend( '$text', { allowIn: '$root' } );
	} );
github ckeditor / ckeditor5-markdown-gfm / src / gfmdataprocessor.js View on Github external
constructor() {
		/**
		 * HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.
		 *
		 * @private
		 * @member {module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor}
		 */
		this._htmlDP = new HtmlDataProcessor();
	}