Data render issue
Describe the bug i stored the data typed in the description as you can see in my first picture in my database(mongodb) and when i try to display the data it is displayed in this format as shown in the second picture.
The above picture is the form description component
the above picture is how the editor value is displayed
the above 2 images are the editor.tsx file and onEditorChange function.
can someone give me an idea on how to fix this issue
Hmm not sure I entirely understand the issue you're having. blocknote.topLevelBlocks gets all the non-nested blocks in the editor in a JSON format - I suppose for your form you just want the text content, is that correct?
@matthewlipski yeah . i just want the text content to be displayed on the fetched post data. my website is basically a blog website consisting of a title, summary and a description. This descrption has the editor component in it
Ah I see, in that case you will have to process the result of blocknote.topLevelBlocks manually to get that, keep in mind there is also markup information that you may or may not want to keep. But in general I would probably use blocknote.forEachBlock to traverse all blocks & their children, get just the text content from block.content for each block, and then set the form value to the concatenation of the text content of each block. Have a look at these doc pages, they should help you out:
Traversing all blocks: https://www.blocknotejs.org/docs/manipulating-blocks#traversing-all-blocks
How block.content is structured (helpful to define a function that just gets text content): https://www.blocknotejs.org/docs/inline-content
@matthewlipski thank you . ill look into the docs and btw by the text content i meant like the markup and other features the blocknote editor gives us. i want the description to be highly customizable so that the user can express his blog post however they want to.
Closing, we'll need a bit clearer description / requirements if this is still an issue in 0.12