Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor tag inner text not rendering. #212

Open
ahamed opened this issue Jan 30, 2020 · 1 comment
Open

Anchor tag inner text not rendering. #212

ahamed opened this issue Jan 30, 2020 · 1 comment

Comments

@ahamed
Copy link

ahamed commented Jan 30, 2020

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?

@jaesharma
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants