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 · Fixed by #418
Open
1 task done

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

Darginec05 opened this issue Oct 8, 2024 · 4 comments · Fixed by #418

Comments

@Darginec05
Copy link
Collaborator

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: https://github.com/Darginec05/Yoopta-Editor/blob/faa418c8de51aa05361f9e1cf4dacaee0ce59c0f/packages/core/editor/src/parsers/deserializeTextNodes.ts#L7

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: https://github.com/Darginec05/Yoopta-Editor/blob/faa418c8de51aa05361f9e1cf4dacaee0ce59c0f/packages/plugins/lists/src/plugin/BulletedList.tsx#L37

After playing with it I got this lovely result:

image

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

@Darginec05
Copy link
Collaborator 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
Collaborator Author

@gloaysa roger that

Darginec05 added a commit that referenced this issue Dec 30, 2024
* fix: depth issues in BulletedList with md serialize/deserialize; closes #345

* chore: remove console.log

* fix: list item children as list-item Descendant type

* update email examples (#391)

## Description

Added the ability to add Loom & Wistia videos in the Video plugin. Note that I'm not used to Typescrpt at all, so I might need some help with this if you see issues.

Fixes # (issue)

## Type of change

Please tick the relevant option.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist:

- [ ] I have performed a self-review of my own code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have checked my code and corrected any misspellings

* Improvements for loom and wistia videos (#402)

* update email examples
## Description

Added the ability to add Loom & Wistia videos in the Video plugin. Note that I'm not used to Typescrpt at all, so I might need some help with this if you see issues.

Fixes # (issue)

## Type of change

Please tick the relevant option.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist:

- [ ] I have performed a self-review of my own code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have checked my code and corrected any misspellings

* fixes for loom and wistia providers

---------

Co-authored-by: 5andu <[email protected]>

* Update deserialize.ts (#415)

* fix types

* add smooth selection between block

* fix: changes after review plus clean empty nodes

* fix: nested TodoList items

---------

Co-authored-by: Alexandru Golovatenco <[email protected]>
Co-authored-by: Akhmed Ibragimov <[email protected]>
Co-authored-by: 5andu <[email protected]>
Co-authored-by: Vaishnav Deore <[email protected]>
@Darginec05 Darginec05 mentioned this issue Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants