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] insertMarkdown() doesn't work correctly when editing in "source" mode #636

Open
2 tasks done
zjullion opened this issue Nov 20, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@zjullion
Copy link

  • 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
insertMarkdown() doesn't work correctly when editing in "source" mode with the diffSourcePlugin - specifically, any edits made in "source" mode will be undone, and the text will be inserted based on the last state from "rich-text" mode.

Reproduction
See https://codesandbox.io/p/sandbox/mdx-editor-base-forked-tzrt6v

To Reproduce

  1. Click the toggle into source mode
  2. Add some markdown
  3. Click the "Insert Markdown" button
  4. See that your changes are lost

Expected behavior
I would expect insertMarkdown() to behave the same way in "rich-text" and "source" mode.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome

Additional context
N/A

@zjullion zjullion added the bug Something isn't working label Nov 20, 2024
@petyosi petyosi changed the title [BUG] [BUG] insertMarkdown() doesn't work correctly when editing in "source" mode Nov 20, 2024
@petyosi
Copy link
Contributor

petyosi commented Nov 20, 2024

@zjullion this is not implemented indeed. Happy to accept a PR.

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

2 participants