I’m trying to modify the textblockTypeInputRule to keep the matching characters on an input rule trigger. Specifically, wrap ``` in a codeblock without deleting the backticks in the same transaction.
My first thought is to remove the delete, replacing
The input-rules plugin handles the text input, so indeed, the action is produces replaces the actual insertion, and if you want to keep it, you’ll have to insert it. You should be able to leave the initial two ticks alone and just insert the last one, I guess.
Instead of having a button that changes codeblock language, I would prefer to use the markdown syntax of three backticks. I really enjoyed how syntax highlighting for codeblocks worked in codemirror (https://codemirror.net/mode/markdown/) so I’m trying to reimplement the same thing in ProseMirror.
Thx for sharing the story. I can see what you mean, but I can’t imagine how that looks like. In my experience supporting for code blocks is either plain markup (like this editor I use to write this reply), or WYSIWYG.