draft-js-utils
draft-js-utils copied to clipboard
Anchor tag inner text not rendering.
entityStyleFn: (entity) => {
const entityType = entity.get('type').toLowerCase();
const data = entity.getData();
switch(entityType){
case 'attachment':
return {
element: 'a',
attributes: { href: data.url }
}
}
}
let html = stateToHTML(contentState, options);
It returns html :
<figure><a href="...." > </a></figure>
How to get something like that
<figure><a href="...." >Some Text</a></figure>
Note: It returns
as inner text. But I need Some Text
as inner Text but how?
Stuck on this same issue, have you find any solution for this? @ahamed