Closed doorkey closed 3 hours ago
Hi @doorkey, thanks for reporting this!
Could you share the json of the blocks that you're trying to load?
Hi @doorkey, thanks for reporting this!
Could you share the json of the blocks that you're trying to load?
[ { "id": "588f083d-c190-477b-8d63-dc5f63019840", "type": "heading", "props": { "textColor": "default", "backgroundColor": "default", "textAlignment": "left", "level": 2 }, "content": [ { "type": "text", "text": "This is a test doc" } ], "children": [] }, { "id": "1bb7080a-0975-4c13-8d96-a71ca52a1ec6", "type": "paragraph", "props": { "textColor": "default", "backgroundColor": "default", "textAlignment": "left" }, "content": [ { "type": "text", "text": "Nice" }, { "type": "text", "text": " job", "styles": { "italic": true } } ], "children": [] }, { "id": "368781c7-7bab-4734-a629-ff9f70f581c9", "type": "paragraph", "props": { "textColor": "default", "backgroundColor": "default", "textAlignment": "left" }, "content": [], "children": [] }, { "id": "cae662cf-3d54-40fa-ad58-31fa8f70a2d2", "type": "paragraph", "props": { "textColor": "default", "backgroundColor": "default", "textAlignment": "left" }, "content": [], "children": [] } ]
@YousefED please check above and let me know if you need anything else.
Thanks. Both these items:
"content": [
{
"type": "text",
"text": "This is a test doc"
}
],
and
"content": [
{
"type": "text",
"text": "Nice"
},
I'm missing a styles
key. Normally, I'd expect this:
"content": [
{
"type": "text",
"text": "Nice",
"styles": {}
},
When you access editor.document
, it should always contain this empty styles object. Do you know where you are losing this information?
@YousefED thanks, we will change our modal and try it. Appreciate.
Describe the bug BlockNote could not convert the snapshot structure to blocks, probably due to styles incompatibility. Possible buggy code.
Please check the comments in the code for the exact line that throws error.
Misc