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 way to cancel inputrules and pasterules #2368

Merged
merged 1 commit into from Jan 10, 2022

Conversation

philippkuehn
Copy link
Contributor

@philippkuehn philippkuehn commented Jan 10, 2022

With this PR it’s possible to cancel inputRules and pasteRules. The issue is also described in #2225.

new InputRule({
  handler: ({ state, range, match }) => {
    // cancel input rule when returning `null`
    if (true) {
      return null
    }

    // ...
  }
})

Caveat

Pasterules work slightly differently because a match can appear in several nodes at the same time. When returning null, the rule for all occurrences is not applied.

fixes #2348

@netlify
Copy link

netlify bot commented Jan 10, 2022

✔️ Deploy Preview for tiptap-embed ready!

🔨 Explore the source changes: ca2b410

🔍 Inspect the deploy log: https://app.netlify.com/sites/tiptap-embed/deploys/61dc35011322ac00087ff253

😎 Browse the preview: https://deploy-preview-2368--tiptap-embed.netlify.app

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.

Cannot add number in the front of heading text
1 participant