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

[BUG] Depth issues with md serialize/deserialize #345

Open
1 task done
Darginec05 opened this issue Oct 8, 2024 · 4 comments · May be fixed by #347
Open
1 task done

[BUG] Depth issues with md serialize/deserialize #345

Darginec05 opened this issue Oct 8, 2024 · 4 comments · May be fixed by #347

Comments

@Darginec05
Copy link
Owner

Has this bug been raised before?

  • I have checked "open" AND "closed" issues and this is not a duplicate

Description

Depth issues with md serialize/deserialize

Steps to Reproduce

Screenshots

Screenshot 2024-10-08 at 17 19 16

Do you want to work on this issue?

No

If "yes" to above, please explain how you would technically implement this

No response

@gloaysa
Copy link

gloaysa commented Oct 8, 2024

After having a look at it and for future reference:

It looks like the root of the issue is that the plugins BulletedList and Numbered list are not ready to handle nested ul/ol elements inside of it.

We might have to tweak this function:

export function deserializeTextNodes(editor: YooEditor, nodes: NodeListOf<ChildNode>): Descendant[] {

and look for ul/ol elements nested inside another ul/ol element to be able to add children to the children of the BulletedList in the parse function:

After playing with it I got this lovely result:

image

So I think I'm on the good track here.

@Darginec05
Copy link
Owner Author

@gloaysa I checked, and yeap, you are right.
It seems we need recursively run deserialize function instead children: deserializeTextNodes(editor, listItem.childNodes) in parse methods for list plugin.
And by running deserialize, we need to collect blocks with the right depth in the block.meta

@gloaysa
Copy link

gloaysa commented Oct 10, 2024

I'll take care of it during the weekend, I'll have more time then @Darginec05

@Darginec05
Copy link
Owner Author

@gloaysa roger that

@gloaysa gloaysa linked a pull request Oct 12, 2024 that will close this issue
9 tasks
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

Successfully merging a pull request may close this issue.

2 participants