I’m having a trouble that, I can’t get my input rules triggered at anytime.
for instace,
I have an input rule for /{{[a-z]+}}/, it will work fine it I type a "}" right after "{{hello}", it will just get triggered.
But if have "{hello}}" in my conext, and I put a "{" in front of "{hello}}", it won’t get triggered because the new char comes at the begining of the match.
I wonder is there any way or workaround that I can use to trigger input rules at anytime?
I’ve tried tweaking the code from prosemirror-inputrules repo but it’s really hard to handle the cursors and matches .
You might have to fork prosemirror-inputrules to handle this (?):
The logic right now only looks for text before the current cursor location ($from), so to do what you want you’ll have to allow for a forward offset as well, e.g.