-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 (mention/heading): clashing heading markdown command and mention/suggestion with # #4954
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
327928e
to
27ddfbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool! Thank you so much 🙌
@@ -16,7 +16,7 @@ export const MentionPluginKey = new PluginKey('mention') | |||
|
|||
export const Mention = Node.create<MentionOptions>({ | |||
name: 'mention', | |||
|
|||
priority: 101, // Fixes collision with Heading '#' input rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be so nit-picky, but can you please insert breaks before and after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put the comment on a separate line, I hope that's what you meant.
@bdbch what do you think? What do you think of this solution? |
@VV-EE we are still in internal discussion to find a better way to respect the priority of the input rules in the ExtensionManager. |
13ae879
to
73c16f8
Compare
I get it, this is a workaround, not a solution to the underlying problem. I thought about adding an extra |
73c16f8
to
248cdfd
Compare
Please describe your changes
Fixes #2570
Now mention nodes with # will preempt the heading markdown input rule
How did you accomplish your changes
Instead of using
addInputRules
I've added the heading input rule as a separate ProseMirror plugin. After this higher priority extensions will be ahead of this input rule. For the same reason I set the Mention node's priority to 101.How have you tested your changes
Added 3 E2E tests, one checks if there's no heading created is something is selected from the mention lis, one checks that we can still use the heading shortcut if we don't select anything, one checks if two mention plugins with '@' and '#' can work together.
How can we verify your changes
Run the E2E test, or visit
preview/Examples/HeadingMultipleMention
Remarks
Added some documentation to Mention about higher priority.
Checklist