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

Problem with customChunkRenderer... #86

Open
Sappher opened this issue Sep 28, 2020 · 0 comments
Open

Problem with customChunkRenderer... #86

Sappher opened this issue Sep 28, 2020 · 0 comments

Comments

@Sappher
Copy link

Sappher commented Sep 28, 2020

I've been trying to find a solution online for a while now, for a seemingly simple task. DraftJS doesn't render tag as bold as default (it seems to use ), but I have lots of content with tags so I need that to be supported. Seems relatively easy right?

Well, the problem is that I can't find a documentation ANYWHERE on what types etc. are supported with customChunkRenderer. My problem is as simple as "render as ", and I've tried to achieve that with this:

const content = htmlToDraft(value, (nodename, node) => { if (nodename === 'b') { console.log('Found a tag', node); return { type: 'STRONG', mutability: 'MUTABLE', data: { innerText: node.innerText, innerHTML: node.innerHTML } } } });

I've gathered this example by searching some other examples from the internet, but I seriously haven't found a good source that explains the values of the return object, ie. what different types are available, what should the 'data' object contain etc.

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

1 participant