You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: