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

fix: AI Markdown Parsing #4051

Closed
wants to merge 3 commits into from
Closed

Conversation

supersimple33
Copy link
Contributor

Checklist

  • yarn typecheck
  • yarn lint:fix
  • yarn test
  • yarn brl
  • yarn changeset
  • ui changelog

This PR addresses #4040. I have added a new method which better fills in the ai flag and then I now use the full markdown deserializer.

Copy link

codesandbox bot commented Feb 4, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ❌ Failed (Inspect) Feb 4, 2025 10:23pm

Copy link

changeset-bot bot commented Feb 4, 2025

🦋 Changeset detected

Latest commit: 0b7b7eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@udecode/plate-ai Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@zbeyens
Copy link
Member

zbeyens commented Feb 4, 2025

Thanks for the PR! Could you add unit tests?

@supersimple33
Copy link
Contributor Author

@zbeyens Sorry I would add the tests but I don't have the time. Just a downstream user who noticed a problem and wanted to share fix.

@zbeyens
Copy link
Member

zbeyens commented Feb 4, 2025

No worries. Could you share a video before/after your changes?

@supersimple33
Copy link
Contributor Author

@zbeyens Here is the final product [ignore the small box that's just how we want it on our page].
Before:
https://github.com/user-attachments/assets/f4c4d25f-48b1-4a61-a225-a7e9d251b988
After:
https://github.com/user-attachments/assets/b79aeaee-8bb2-44e1-9937-11a7480ee421

@felixfeng33
Copy link
Collaborator

felixfeng33 commented Feb 6, 2025

Thanks for your help @supersimple33 but this is a tricky issue.

we don't support multiple paragraph mainly because the following issues.
1.when insert new paragraph by ai we need update the menu position to the next paragraph.
2.we need deserialize the inline markdown in the end of paragraph like **bold** marks.

@zbeyens
Copy link
Member

zbeyens commented Feb 6, 2025

@supersimple33 You can use overrideEditor to apply this workaround on your plugin. The plan is to support many blocks without breaking the existing behavior.

@zbeyens zbeyens closed this Feb 6, 2025
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 this pull request may close these issues.

3 participants