Actual Output
<span class="mention" data-mention="@lilypad">@lilypad</span>
Tried below,
writer.createUIElement( 'span', null, function( domDocument ) {
const domElement = this.toDomElement( domDocument );
domElement.innerHTML = 'this is ui element';
return domElement;
} );
Like mentioned here https://ckeditor.com/docs/ckeditor5/latest/api/module_engine_view_writer-Writer.html
editor.conversion.for( 'downcast' ).attributeToElement( { model: 'mention', view: ( modelAttributeValue, { writer } ) => {
writer.createUIElement( 'span', null, function( domDocument ) {
const domElement = this.toDomElement( domDocument );
domElement.innerHTML = 'this is ui element';
return domElement;
});
}
});
But its not working
(https://i.stack.imgur.com/rFIPS.png)
Expected output
<span class="mention mention-parent" data-mention="@lilypad" id="parent-id">@lilypad<span class="mention mention-child" id="child-id">Sample text</span></span>
Please check the documentation for this!
Fully customized mention feed
Here they mention to use the property
itemRenderer: customItemRendererin the object offeedsarray. We can modify the function to suit your needs!This demo does not get the desired output, but its a good starting point to solve your issue!