Problem with customChunkRenderer...
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 163
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the htmlToDraft customChunkRenderer entry point and determine which return fields, entity types, mutability values, and data contents are supported. Document those findings, including the reported b-to-strong example, so a user can identify the valid configuration and know when the documentation is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100