question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hash character with the suggestion utility conflicts with heading Markdown shortcut

See original GitHub issue

What’s the bug you are facing?

When using the # as the char in the Suggestion utility, this conflicts with the heading Markdown shortcut IF it’s the first character in an empty paragraph. Instead of adding the selected suggestion, the paragraph is converted to a heading instead.

How can we reproduce the bug on our side?

  • Take the CodeSandbox as an example
  • Type # into the editor as the first character in an empty paragraph
  • Press <kbd>Enter</kbd> to select an item from the dropdown
  • Observe that the empty paragraph is converted into a heading

Can you provide a CodeSandbox?

What did you expect to happen?

The selected suggestion from the dropdown should’ve been added to the editor.

Anything to add? (optional)

A few observations:

  • I understand that I can disable the heading input rule to work around this issue, but we’re looking for a way to have both things working.
  • After some research I’ve noticed that all input rules take priority over anything else (i.e. the input rules handleKeyDown will take precedence over other extensions/plugins handleKeyDown event handlers, that’s why we have the behavior here described.
  • Possible solution: We need a way to sort ProseMirror plugins based on a priority property (similar to what we have for extensions) so that we can have certain plugins being handled before the input rules plugin.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖 (on behalf of Doist)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
rfgamaralcommented, May 23, 2022

@rfgamaral does the priority have any effect on that issue?

I don’t think it does because the problem here lies in the ProseMirror plugins priority, and not the Tiptap extensions priority (which are 2 different things). As I’ve suggested in the OP, I think we need a way to override the priority for ProseMirror plugins, akin to the Extensions priority field.

0reactions
github-actions[bot]commented, Aug 10, 2022

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitLab Flavored Markdown (GLFM)
headers, linkable Header IDs. images, embedded videos and audio. line breaks, more line break control. links, automatically linking URLs ...
Read more >
How to escape the (hash) # sign in a GitHub markdown ...
I have the following code on a README.md file on GitHub, where I am trying to display the hash sign on a header...
Read more >
Writing R Extensions - The Comprehensive R Archive Network
The utility R CMD build may add files in a build directory (but this should not be used ... Some package listings may...
Read more >
Release Notes - Drafts User Guide
You can also always get highlights of the latest additions in the app via “What's New” (Settings on iOS, Help menu on Mac)....
Read more >
JupyterLab Changelog — JupyterLab 3.6.0b0 documentation
fix run cells breaking on non-header markdown cells #12027 (@andrewfulton9) ... Add additional Accel Enter keyboard shortcuts for the notebook:run-cell ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found