如何将CKEDitor 5 Bold插件应用于我自己的内联元素
我遵循了在的实现内联小部件教程 我想扩展它以启用占位符的粗体显示 我添加了如何将CKEDitor 5 Bold插件应用于我自己的内联元素,ckeditor,ckeditor5,Ckeditor,Ckeditor5,我遵循了在的实现内联小部件教程 我想扩展它以启用占位符的粗体显示 我添加了this.editor.model.schema.extend('placeholder',{allowAttributes:'bold'})到占位符编辑.init(),因此它现在看起来如下所示: init() { this._defineSchema(); this._defineConverters(); this.editor.commands.add('pl
this.editor.model.schema.extend('placeholder',{allowAttributes:'bold'})
到占位符编辑.init()
,因此它现在看起来如下所示:
init() {
this._defineSchema();
this._defineConverters();
this.editor.commands.add('placeholder', new PlaceholderCommand(this.editor));
this.editor.editing.mapper.on(
'viewToModelPosition',
viewToModelPositionOutsideModelElement(this.editor.model, viewElement => viewElement.hasClass('placeholder'))
);
this.editor.config.define( 'placeholderConfig', {
types: [ 'date', 'first name', 'surname' ]
} );
this.editor.model.schema.extend( 'placeholder', { allowAttributes: 'bold' } ); //ADDED
}
然后我将占位符包装在
中,如下所示:
{mike}
inspector向我显示该属性被添加到模型中的占位符中,如下所示:
但是,编辑器中呈现的html没有向下转换
我如何才能做到这一点?目前似乎没有办法做到干净。它已经存在一个问题: