UNPKG

@concordnow/ckeditor5-image-rendering

Version:
29 lines (25 loc) 534 B
import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; export default class ImageDisplay extends Plugin { static get pluginName() { return 'ImageDisplay'; } init() { const editor = this.editor; const conversion = editor.conversion; conversion.for( 'upcast' ) .attributeToAttribute( { view: { name: 'img', styles: { 'display': /[\s\S]+/ } }, model: { key: 'customImageDisplay', value: viewImage => { return viewImage.getStyle( 'display' ); } } } ); } }