fix (mention/heading): clashing heading markdown command and mention/suggestion with # #4954
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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