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] Custom JSX NestedLexicalEditor does not render well #430

Open
2 tasks done
Melvynx opened this issue Apr 24, 2024 · 4 comments
Open
2 tasks done

[BUG] Custom JSX NestedLexicalEditor does not render well #430

Melvynx opened this issue Apr 24, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Melvynx
Copy link

Melvynx commented Apr 24, 2024

First, thanks you very much for this tool.


  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
I create a custom MdxZodEditor that takes a Zod schema and renders the component with settings. Everything works well, except the children component seems to create a not-valid Markdown output.

Reproduction

I created a full repository of the demo here: https://github.com/Melvynx/mdx-remote-bug-reproduction

To Reproduce
Steps to reproduce the behavior:

  1. Go to /demo in the NextJS app.
  2. Click on 'Spoiler' in the toolbar.
  3. Open the Spoiler and add text and a block of code.
  4. Refresh the page.
  5. See the error.

Expected behavior
The output must be a valid Markdown output.

Screenshots
I uploaded a video demo here:

CleanShot.2024-04-24.at.08.21.24.mp4

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome (Arc)

Additional context
In the repository, I have added all my code about the Zod Editor and everything to try and test.

@Melvynx Melvynx added the bug Something isn't working label Apr 24, 2024
@ReadabilityOne
Copy link

I believe JSX and nested editor together have some issue to render complex markdown content, you can use Directive and nested editor to achieve the same thing, which works perfectly based on my experience :)

@petyosi
Copy link
Contributor

petyosi commented Apr 24, 2024

@Melvynx I am getting a lost in the complexity of your example. It looks weird to me that the code block remains on the same line as the rest of the content.

I tried to simplify things down to this sandbox, and, as far as I can tell, it works as expected. Can you replicate the problem here?

Screen.Recording.2024-04-24.at.9.19.17.mov

@Melvynx
Copy link
Author

Melvynx commented May 2, 2024

Hi @petyosi, thank you. I know with the GenericJsxEditor everything seems to work, but I am trying to create a more complex and custom JSX editor without using the GenericJsxEditor. There is a lack of documentation for that.

@petyosi
Copy link
Contributor

petyosi commented May 2, 2024

I do understand that, but I need your help in narrowing down the problematic part of your setup - it is quite complicated and I am lost in it. Can you pinpoint the difference between your implementation and the GenerixJsxEditor (source) and what you're doing that causes the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants