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

Add 'text' to auto-format query method #1053

Merged
merged 9 commits into from
Sep 23, 2021
Merged

Conversation

bensquire
Copy link
Collaborator

As auto-format rules run before text is inserted into the editor, when you use the query option to control validity you cannot access the last thing the user entered. In the case of code-blocks which should be '```' the query method can only derive '``' from the editor.

This PR ensure the last thing typed is also passed into the query method.

Checklist

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn lint --fix.)
  • The relevant examples still work: (Run examples with yarn docs.)

As auto-format rules run before text is inserted into the editor, when you use the query option to control validity you cannot access the last thing the user entered. In the case of code-blocks which should be '```` the query method can only derive '``' from the editor (currentNode).

This PR ensure the last thing typed is also passed into the query method.
@bensquire bensquire added the bug Something isn't working label Sep 22, 2021
@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2021

🦋 Changeset detected

Latest commit: a8d7b40

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

This PR includes changesets to release 2 packages
Name Type
@udecode/plate-autoformat Patch
@udecode/plate Patch

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

@vercel
Copy link

vercel bot commented Sep 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/udecode/plate/9gYiFQJ7zEMFSvPxacd6uWZScx2V
✅ Preview: https://plate-git-bug-autoformat-query-text-udecode.vercel.app

Copy link
Member

@zbeyens zbeyens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, just left one request then we can merge this

@zbeyens zbeyens merged commit 0777a67 into main Sep 23, 2021
@zbeyens zbeyens deleted the bug/autoformat-query-text branch September 23, 2021 08:39
@github-actions github-actions bot mentioned this pull request Sep 23, 2021
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

Successfully merging this pull request may close these issues.

2 participants