draft-js-utils icon indicating copy to clipboard operation
draft-js-utils copied to clipboard

Anchor tag inner text not rendering.

Open ahamed opened this issue 5 years ago • 1 comments

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="...." >&nbsp;</a></figure>

How to get something like that <figure><a href="...." >Some Text</a></figure>

Note: It returns &nbsp; as inner text. But I need Some Text as inner Text but how?

ahamed avatar Jan 30 '20 05:01 ahamed

Stuck on this same issue, have you find any solution for this? @ahamed

jaesharma avatar Oct 07 '21 02:10 jaesharma